Google App Engine に発行する Visual Studio 2012 で django アプリケーションをセットアップしようとしています。開発環境で正常に実行できる pytools を使用して、Visual Studio で簡単な hello World アプリケーションをセットアップしました。
app.yaml ファイルを追加し、AppEngine SDK をダウンロードして、既存のアプリケーションを Google App Engine Launcher アプリケーションにインポートしました。App Engine Launcher を使用してローカルでアプリケーションを起動すると、アプリケーションは起動しますが、ページは単なるエラーです。ログから次の情報を取得します。
2013-05-23 07:47:03 Running command: "['C:\\Python27\\pythonw.exe', 'C:\\Program Files\\Google\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=8080', '--admin_port=8000', 'Z:\\gridtreecontrol\\GridTreeView\\GridTreeView']"
INFO 2013-05-23 07:47:09,496 devappserver2.py:522] Skipping SDK update check.
WARNING 2013-05-23 07:47:09,523 api_server.py:329] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO 2013-05-23 07:47:09,543 api_server.py:153] Starting API server at: http://localhost:61149
INFO 2013-05-23 07:47:09,552 dispatcher.py:164] Starting server "default" running at: http://localhost:8080
INFO 2013-05-23 07:47:09,558 admin_server.py:117] Starting admin server at: http://localhost:8000
ERROR 2013-05-23 12:47:32,108 wsgi.py:235]
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\runtime\wsgi.py", line 223, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "C:\Program Files\Google\google_appengine\lib\django-1.4\django\core\handlers\wsgi.py", line 219, in __call__
self.load_middleware()
File "C:\Program Files\Google\google_appengine\lib\django-1.4\django\core\handlers\base.py", line 39, in load_middleware
for middleware_path in settings.MIDDLEWARE_CLASSES:
File "C:\Program Files\Google\google_appengine\lib\django-1.4\django\utils\functional.py", line 184, in inner
self._setup()
File "C:\Program Files\Google\google_appengine\lib\django-1.4\django\conf\__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "C:\Program Files\Google\google_appengine\lib\django-1.4\django\conf\__init__.py", line 95, in __init__
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'settings' (Is it on sys.path?): No module named settings
INFO 2013-05-23 07:47:32,128 server.py:585] default: "GET / HTTP/1.1" 500 -
sys.path を調整してほしいようですが、そうすると Google App Engine の本番サーバーに変更が反映されない気がします。アプリケーションをサーバーに公開しようとしましたが、同じエラーが発生します。
Visual Studio でアプリケーションを実行すると、このエラーは発生しません。