[Django]-Django 1.4 on GAE: sqlite "ImportError: cannot import name utils"

4đź‘Ť

âś…

As it’s not good practice to use sqlite in dev and mysql (as used by Cloud SQL) in production I don’t recommend this setup to anyone.

Then, there is the option --use_sqlite: This is used to speed up development when using the Google Datastore. There is no similar option for Cloud SQL.

👤hansaplast

4đź‘Ť

This can be resolved by whitelisting the sqlite3 module by appending _sqlite3 to _WHITE_LIST_C_MODULES in /usr/local/google_appengine/google/appengine/tools/dev_appserver_import_hook.py.

Note, you’ll need to have selected “Make Symlinks…” in the app engine launcher to to access the file from /usr/local.

👤Martin Ogden

1đź‘Ť

In the latest version of the SDK, you can enable the sqlite3 module in the sandbox by adding

'sqlite3' in name.lower()

in the _should_keep_module function in google-app-engine/google/appengine/tools/devappserver2/python/sandbox.py (around line 195)

👤georgerw

Leave a comment