本文介绍了Google应用部署中的django-nonrel 500服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我创建了一个名为helloapp的新应用程序。 1)我在views.py中创建了一个名为hello world的视图: 2)然后我使用以下方式将它链接到了urls.py中: 这适用于本地,但在实况中,我收到了500个服务器错误。 在GAE日志中,我看到我收到导入错误 > ImportError:没有名为helloapp.views的模块 这是co nfusing因为,如上所述,这在当地正常工作。 帮助。解决方案也许试试这个: from views import hello 本地您的views.py位于helloapp目录中。但是,当它上传到应用引擎时,它会被放到一个类似这样的版本号的目录中,其中helloapp.views不存在: / base / data / home /apps/helloapp/1.23456789/views.py I am a newbie with a problem working with Django-nonrel on Google App Engine.I created a new app called "helloapp".1) I have created a view in views.py called hello world:2) I have then linked to it in the urls.py using:This works fine locally, but on live I am getting 500 Server error.In the GAE logs I see that I am getting an import error ImportError: No module named helloapp.viewsThis is confusing since, as mentioned, this works fine locally.Help. 解决方案 Maybe try this:from views import helloLocally your views.py is in a helloapp directory. But when it gets uploaded onto app engine it is placed into a directory with a version number like this, where helloapp.views does not exist:/base/data/home/apps/helloapp/1.23456789/views.py 这篇关于Google应用部署中的django-nonrel 500服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
06-27 00:07
查看更多