procoder 发表于 3-1-2010 14:02:33

Google App Engine CMS系统的搭建

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.pyconfiguration.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是所有页面的页脚。如下图
http://images.cnblogs.com/cnblogs_com/procoder/WindowsLiveWriter/2e066c047608_10CD2/google-app-engine-cms-1_thumb.png
还需要定义SYSTEM_TITLE和SYSTEM_DESCRIPTION。 ANALYTICS_ID用于Google Analytics,不是必须的。

修改app.yamlapp.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)|

(.*/RCS/.*)|

(\..*)|

(dev/.*)|

(tests/.*)|

(docs/.*)|

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

测试使用Google App Engine Launcher测试定制的CMS。增加一个新应用,指向App Engine Site Creator解压的本地目录。
http://images.cnblogs.com/cnblogs_com/procoder/WindowsLiveWriter/2e066c047608_10CD2/google-app-engine-cms-2_thumb.png
点击Browse可以测试。
http://images.cnblogs.com/cnblogs_com/procoder/WindowsLiveWriter/2e066c047608_10CD2/google-app-engine-cms-3_thumb.png

部署使用Google App Engine Launcher可以把应用不是到Google App Engine上。
配置应用属性http://images.cnblogs.com/cnblogs_com/procoder/WindowsLiveWriter/2e066c047608_10CD2/google-app-engine-cms_thumb.png
首先需要配置应用的属性,Deployment Server 需要填写 appengine.google.com开始我填错了,填了自己应用的网址,一直没有成功。
上传http://images.cnblogs.com/cnblogs_com/procoder/WindowsLiveWriter/2e066c047608_10CD2/google-app-engine-cms-4_thumb.png
点击"Deploy”,填写Email和密码上传应用。

预览http://images.cnblogs.com/cnblogs_com/procoder/WindowsLiveWriter/2e066c047608_10CD2/google-app-engine-cms-5_thumb.png
可以通过www.linsoftware.com来访问,但是可能国内给河蟹了,所以请使用linsoftwaresite.appspot.com来预览。
关于Google App Engine的开发可以参考一下下面的链接,不错的教材。
http://code.google.com/appengine/docs/python/gettingstarted/introduction.html

原文见http://www.cnblogs.com/procoder/archive/2010/01/03/Google-App-Engine-CMS.html

procoder 发表于 3-1-2010 14:03:45

拷贝过来格式没掉了,:L :L

zycbob 发表于 3-1-2010 17:21:23

看过你博客上的文章了:lol

ubuntuhk 发表于 3-1-2010 17:40:19

回复 #1 procoder 的帖子

关于GAE实战的介绍文章好像不是很多,procoder这篇帖子不错:good

不过我有点小担心,Google万一进不了将来的白名单,那些急于GAE、面对国内用户的应用怎么办:L :L ,不过这个担心可能有点远。

cnlancer 发表于 4-1-2010 12:30:39

最近也研究了一下GAE,以前没用过python,想找个java的能在GAE上跑的cms,lz找过类似的吗?

procoder 发表于 6-1-2010 21:42:24

原帖由 cnlancer 于 4-1-2010 12:30 发表 http://www.freeoz.org/bbs/images/common/back.gif
最近也研究了一下GAE,以前没用过python,想找个java的能在GAE上跑的cms,lz找过类似的吗?
我喜欢Python的。

flyspirit 发表于 5-2-2010 11:57:39

楼主的Blog很有些内容。
页: [1]
查看完整版本: Google App Engine CMS系统的搭建