简体   繁体   中英

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

I'm running Django 1.3 in a virtualenv with python 2.7 on OSX Mountain Lion. When I run dev_appserver.py I get this thrown at me. (Ignore the warning about the images API .

Question: Why am I getting a mysqldb warning when I'm using ndb ?

Question: Do I need to do anything about the warning?

This is my first time working with Python, Django, and AppEngine, so I don't know if I'm doing something wrong in the setup process. I haven't done anything with the database (eg 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',
)

you only need Mysqldb if you intend to use Cloud SQL. https://developers.google.com/cloud-sql/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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