繁体   English   中英

Google Appengine / Django / NDB安装程序在服务器启动时引发mysqldb错误

[英]Google Appengine / Django / NDB setup throws mysqldb error on server start

我在OSX Mountain Lion的python 2.7的virtualenv中运行Django 1.3。 当我运行dev_appserver.py时,我就把它扔了。 (忽略有关images API的警告。

问题:使用ndb时为什么会收到mysqldb警告?

问题:我需要对警告采取任何措施吗?

这是我第一次使用Python,Django和AppEngine,所以我不知道我在设置过程中是否做错了什么。 我没有对数据库做任何事情(例如syncdb

WARNING  2012-12-29 21:05:26,272 rdbms_mysqldb.py:74] The rdbms API is not available because the MySQLdb library could not be loaded.
INFO     2012-12-29 21:05:26,356 appcfg.py:586] Checking for updates to the SDK.
INFO     2012-12-29 21:05:26,795 appcfg.py:604] The SDK is up to date.
WARNING  2012-12-29 21:05:26,795 dev_appserver.py:3571] The datastore file stub is deprecated, and
will stop being the default in a future release.
Append the --use_sqlite flag to use the new SQLite stub.

You can port your existing data using the --port_sqlite_data flag or
purge your previous test data with --clear_datastore.

WARNING  2012-12-29 21:05:26,795 datastore_file_stub.py:518] Could not read datastore data from /var/folders/92/tl1hq8ps1v18n1m68s6fxkp00000gn/T/dev_appserver.datastore
WARNING  2012-12-29 21:05:26,797 dev_appserver.py:3670] Could not initialize images API; you are likely missing the Python "PIL" module. ImportError: No module named _imaging
INFO     2012-12-29 21:05:26,802 dev_appserver_multiprocess.py:655] Running application dev~google-solveforx on port 8080: http://localhost:8080
INFO     2012-12-29 21:05:26,802 dev_appserver_multiprocess.py:657] Admin console is available at: http://localhost:8080/_ah/admin

app.yaml

application: appname
version: staging
runtime: python27
api_version: 1
threadsafe: false

main.py

import os
from django.core.handlers import wsgi
from google.appengine.ext import ndb

os.environ['DJANGO_SETTINGS_MODULE'] = 'appname.settings'

# Wrapping the WSGI application in ndb.toplevel ensures that all async
# operations complete before returning.
application = ndb.toplevel(wsgi.WSGIHandler())

settings.py

import os

DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')

ROOT_URLCONF = 'solveforx.urls'

MIDDLEWARE_BASE = 'solveforx.lib.middleware'

MIDDLEWARE_CLASSES = (
    'django.middleware.csrf.CsrfViewMiddleware',
    '%s.SecurityMiddleware' % MIDDLEWARE_BASE,
    '%s.TemplateContext' % MIDDLEWARE_BASE,
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.csrf',
    'django.core.context_processors.request',
)

# By default django will load the templates under templates/ directory under
# every installed apps.
INSTALLED_APPS = (
    'appname.frontend',
)

如果您打算使用Cloud SQL,则仅需要Mysqldb。 https://developers.google.com/cloud-sql/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM