以下是用到的settings.py中用到的代码:
if 'SERVER_SOFTWARE' in os.environ:#本地和sae环境使用不同的配置
DOMAIN='http://deltatest.sinaapp.com'
DB_HOST='w.rdc.sae.sina.com.cn'
DB_PORT='3307'
DB_USER=ACCESSKEY
DB_PASS=SECRETKEY
DB_DB='app_APPNAME'
#CACHES_BACKEND=
UEDITOR_UPLOAD={
'BACKEND':'DjangoUeditor.saebackend',
'DOMAIN':'APPNAME',
}
else:
DOMAIN = 'http://localhost:8000'
CACHES_BACKEND = 'django.core.cache.backends.memcached.MemcachedCache'
if False:
DB_HOST='localhost'
DB_PORT=''
DB_USER='本地数据库用户名'
DB_PASS='本地数据库密码'
DB_DB='本地数据库名'
else:
from sae._restful_mysql import monkey
monkey.patch()
DB_HOST='w.rdc.sae.sina.com.cn'
DB_PORT='3307'
DB_USER='ACCESSKEY'
DB_PASS='SECRETKEY'
DB_DB='app_APPNAME'