Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何让Google应用程序引擎在本地运行_Python_Django_Google App Engine - Fatal编程技术网

Python 如何让Google应用程序引擎在本地运行

Python 如何让Google应用程序引擎在本地运行,python,django,google-app-engine,Python,Django,Google App Engine,我正在尝试让Python Google应用程序引擎在本地运行(macOS Sierra),我遇到了各种各样的问题,想知道我可能会错过什么。请注意,这是我第一次尝试Python(通常使用Ruby开发) 我已经下载了Google App Engine sdk for python,并按照步骤将其安装并运行。几次尝试后,我将其放置在与我的应用程序相同的目录中 我使用的是Python 2.7.x,这正是应用程序所需要的 我正在使用virtualenv,所以我启动了它,就像这样:source-bin/ac

我正在尝试让Python Google应用程序引擎在本地运行(macOS Sierra),我遇到了各种各样的问题,想知道我可能会错过什么。请注意,这是我第一次尝试Python(通常使用Ruby开发)

我已经下载了Google App Engine sdk for python,并按照步骤将其安装并运行。几次尝试后,我将其放置在与我的应用程序相同的目录中

我使用的是Python 2.7.x,这正是应用程序所需要的

我正在使用virtualenv,所以我启动了它,就像这样:
source-bin/activate
并尝试像这样运行应用程序:
dev\u-appserver.py--storage\u path=../GAE-storage/--port=9080--log\u level=info$*。

当我尝试访问该页面时,会出现如下错误:

Traceback (most recent call last):
File "/Users/wm/lib/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/Users/wm/lib/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 354, in __getattr__
self._update_configs()
File "/Users/wm/lib/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 290, in _update_configs
self._registry.initialize()
File "/Users/wm/lib/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 165, in initialize
import_func(self._modname)
File "/Library/WebServer/Documents/python/flow.city/appengine_config.py", line 19, in <module>
from django.conf import settings
ImportError: No module named django.conf
INFO     2016-11-20 11:09:47,599 module.py:788] default: "GET / HTTP/1.1" 500 -
回溯(最近一次呼叫最后一次):
文件“/Users/wm/lib/google cloud sdk/platform/google\u appengine/google/appengine/runtime/wsgi.py”,第240行,在Handle中
handler=\u config\u handle.add\u wsgi\u中间件(self.\u LoadHandler())
文件“/Users/wm/lib/google cloud sdk/platform/google\u appengine/google/appengine/api/lib\u config.py”,第354行,位于__
self.\u update\u configs()
文件“/Users/wm/lib/google cloud sdk/platform/google\u appengine/google/appengine/api/lib\u config.py”,第290行,在更新配置中
self.\u registry.initialize()
文件“/Users/wm/lib/google cloud sdk/platform/google\u appengine/google/appengine/api/lib\u config.py”,第165行,在初始化中
导入函数(self.\u modname)
文件“/Library/WebServer/Documents/python/flow.city/appengine_config.py”,第19行,在
从django.conf导入设置
ImportError:没有名为django.conf的模块
INFO 2016-11-20 11:09:47599 module.py:788]默认值:“GET/HTTP/1.1”500-
所以,为了解决这个问题,我手动下载了Django并将其解压缩到app目录。然后它抱怨我没有这些功能,所以我也手动下载并添加到项目目录中。现在他在抱怨别的事情:

ERROR    2016-11-20 11:29:18,635 wsgi.py:263] 
Traceback (most recent call last):
File "/Users/wm/lib/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/Users/wm/lib/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 354, in __getattr__
self._update_configs()
File "/Users/wm/lib/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 290, in _update_configs
self._registry.initialize()
File "/Users/wm/lib/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 165, in initialize
import_func(self._modname)
File "/Library/WebServer/Documents/python/flow.city/appengine_config.py", line 22, in <module>
import features
File "/Library/WebServer/Documents/python/flow.city/flowcity/features.py", line 23, in <module>
from base.basics import get_config
File "/Library/WebServer/Documents/python/flow.city/flowcity/base/basics.py", line 13, in <module>
from dbutils import date_to_str, rescale, get_app_url
File "/Library/WebServer/Documents/python/flow.city/flowcity/dbutils.py", line 23, in <module>
from i18n import _
File "/Library/WebServer/Documents/python/flow.city/flowcity/i18n.py", line 12, in <module>
from django.utils.translation import *
TypeError: Item in ``from list'' not a string
INFO     2016-11-20 11:29:18,641 module.py:788] default: "GET / HTTP/1.1" 500 -
错误2016-11-20 11:29:18635 wsgi.py:263]
回溯(最近一次呼叫最后一次):
文件“/Users/wm/lib/google cloud sdk/platform/google\u appengine/google/appengine/runtime/wsgi.py”,第240行,在Handle中
handler=\u config\u handle.add\u wsgi\u中间件(self.\u LoadHandler())
文件“/Users/wm/lib/google cloud sdk/platform/google\u appengine/google/appengine/api/lib\u config.py”,第354行,位于__
self.\u update\u configs()
文件“/Users/wm/lib/google cloud sdk/platform/google\u appengine/google/appengine/api/lib\u config.py”,第290行,在更新配置中
self.\u registry.initialize()
文件“/Users/wm/lib/google cloud sdk/platform/google\u appengine/google/appengine/api/lib\u config.py”,第165行,在初始化中
导入函数(self.\u modname)
文件“/Library/WebServer/Documents/python/flow.city/appengine_config.py”,第22行,在
导入功能
文件“/Library/WebServer/Documents/python/flow.city/flowcity/features.py”,第23行,在
从base.basics导入获取配置
文件“/Library/WebServer/Documents/python/flow.city/flowcity/base/basics.py”,第13行,在
从dbutils导入日期\u到\u str,重新缩放,获取\u应用程序\u url
文件“/Library/WebServer/Documents/python/flow.city/flowcity/dbutils.py”,第23行,在
从i18n导入_
文件“/Library/WebServer/Documents/python/flow.city/flowcity/i18n.py”,第12行,在
从django.utils.translation导入*
TypeError:“来自列表”中的项不是字符串
INFO 2016-11-20 11:29:18641 module.py:788]默认值:“GET/HTTP/1.1”500-
因此,我想知道我所采取的方法是否是让应用程序在本地运行的正确方法?在Ruby中克隆新项目时,我会进行
捆绑安装
,以便下载该项目的所有需求。Python中有类似的东西我应该做吗


请注意,我也尝试过不使用virtualenv,结果是一样的。

发布app.yaml的内容(如果在其中,则减去应用程序ID)。发布app.yaml的内容(如果在其中,则减去应用程序ID)。