0

我在 OSX Mountain Lion 上使用 python 2.7 在 vi​​rtualenv 中运行 Django 1.3。当我运行 dev_appserver.py 时,我遇到了这个问题。(忽略关于images API.

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

问题:我需要对警告做些什么吗?

这是我第一次使用 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

应用程序.yaml

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

主文件

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())

设置.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',
)
4

1 回答 1

1

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

于 2012-12-29T21:26:19.353 回答