欢迎您! | 积分 | 主页 |
注册 | 登陆 |
官方QQ群: 8807551

Google App Engine CMS系统的搭建

发布日期:2010-01-03 13:10:06.0 发布讲师:don 浏览量:514
课程类别:IT电脑开发
学习标签: Google CMS
免费在线正则表达式验证工具! 免费在线HTML/JS/CSS调试工具!


点击放大图片-Google App Engine CMS系统的搭建

简介

圣诞假期期间试着使用Google App Engine搭建了一个CMS系统,挺简单的,而且稳定和免费。把搭建过程Blog下来。

 

软件下载

下载Python

下载ActivePython 2.5.4.4并安装。

http://www.activestate.com/activepython/downloads/

 

下载Google App Engine SDK

下载Google App Engine SDK for Python,我使用Python而不是Java。

http://code.google.com/appengine/downloads.html

 

下载App Engine Site Creator

我使用开源软件App Engine Site Creator,下载并解压到本地目录

http://code.google.com/p/app-engine-site-creator/wiki/TechnicalOverview

 

定制

修改configuration.py

configuration.py用于定制App Engine Site Creator系统的,代码如下:

#!/usr/bin/python2.5
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

"""System-wide configuration variables."""

import datetime


# This HTML block will be printed in the footer of every page.
FOOTER_HTML = (
‘‘Copyright @ Lin Software 2009 | ‘‘
‘‘Designed By Jake Lin‘‘
‘‘<img src="http://code.google.com/appengine/images/appengine-noborder-120x30.gif"‘‘
‘‘alt="Powered by Google App Engine" />‘‘
)


# File caching controls
FILE_CACHE_CONTROL = ‘‘private, max-age=86400‘‘
FILE_CACHE_TIME = datetime.timedelta(days=1)


# Title for the website
SYSTEM_TITLE = ‘‘Lin Software‘‘

# Description for the website
SYSTEM_DESCRIPTION = ‘‘Welcome to Lin Software site‘‘

# Unique identifier from Google Analytics (ie. UA-xxxxxxx-x)
ANALYTICS_ID = ‘‘UA-xxx‘‘

# Name of theme for your site, must be located in
# ‘‘templates/themes/{FOLDER NAME}‘‘ where your customized
# base and page files should be located
SYSTEM_THEME_NAME = ‘‘nautica05‘‘

 

 

FOOTER_HTML是所有页面的页脚。如下图

google-app-engine-cms-1

还需要定义SYSTEM_TITLE和SYSTEM_DESCRIPTION。 ANALYTICS_ID用于Google Analytics,不是必须的。

 

修改app.yaml

app.yaml定义Google App Engine的应用的信息。

application: linsoftwaresite
version: 2
runtime: python
api_version: 1

default_expiration: "1d"

handlers:
- url: /favicon.ico
static_files: static/images/favicon.ico
upload: static/images/favicon.ico

- url: /static/images/fileicons/.*
script: zip_handler.py

- url: /fckeditor/.*
script: zip_handler.py

- url: /static
static_dir: static

- url: /admin/.*
script: main.py
login: required

- url: /.*
script: main.py



skip_files: |
^(.*/)?(
(app.yaml)|
(app.yml)|
(index.yaml)|
(index.yml)|
(#.*#)|
(.*~)|
(.*.py[co])|
(.*/RCS/.*)|
(..*)|
(dev/.*)|
(tests/.*)|
(docs/.*)|
)$

我的应用的ID是linsoftwaresite。所以把application修改为linsoftwaresite。

 

测试

使用Google App Engine Launcher测试定制的CMS。增加一个新应用,指向App Engine Site Creator解压的本地目录。

google-app-engine-cms-2

点击Browse可以测试。

google-app-engine-cms-3

 

部署

使用Google App Engine Launcher可以把应用不是到Google App Engine上。

配置应用属性

google-app-engine-cms

首先需要配置应用的属性,Deployment Server 需要填写 appengine.google.com开始我填错了,填了自己应用的网址,一直没有成功。

上传

google-app-engine-cms-4

点击"Deploy”,填写Email和密码上传应用。

 

预览

google-app-engine-cms-5

可以通过www.linsoftware.com来访问,但是可能国内给河蟹了,所以请使用linsoftwaresite.appspot.com来预览。

关于Google App Engine的开发可以参考一下下面的链接,不错的教材。

http://code.google.com/appengine/docs/python/gettingstarted/introduction.html


2010-01-03 13:17:39.0 用户don说:
免费,强大!

验证码:验证码

网店名字Don的知识网店
网店店主don
相关课程(共8个):
讲师:don 浏览数:89
2010-06-07 10:17:07.
讲师:don 浏览数:1124
2010-04-30 00:18:02.
讲师:don 浏览数:110
2010-04-16 10:06:00.
讲师:don 浏览数:200
2010-04-11 23:36:22.
讲师:don 浏览数:199
2010-03-23 09:51:42.
讲师:don 浏览数:1043
2010-03-18 10:12:24.
讲师:don 浏览数:310
2010-02-06 12:24:05.
讲师:don 浏览数:185
2010-02-01 23:45:25.



©2008 - 沪ICP备07037037号 - 简历 - SQL管理 - 邮箱登陆 - RSS阅读