我的文件结构如下:
app.yaml
something/
__init__.py
models.py
test.py
我已将URL设置为在app.yaml
中运行tests.py
:
test.py
进口models.py
当我试图导航到http://myapp.appspot.com/test/
时,我得到以下错误:
Error: Server Error The server encountered an error and could not complete your request. If the problem persists, please report your problem and mention this error message and the > query that caused it
当我检查仪表板上的日志时,我看到发生了以下错误:
<type 'exceptions.ImportError'>: No module named models
如何正确导入文件?在
干杯
皮特
内部测试.py你可以在上面写一些东西,比如:
这将导入模型。 不过,对于更正代码,通配符“*”不是很好,您可以显式导入使用的模型:
^{pr2}$等等。在
尝试按如下方式导入
models
:在测试.py应该有}
imports models
,而不是{相关问题 更多 >
编程相关推荐