Heroku: ImportError: No module named site

非 Y 不嫁゛ 提交于 2019-12-31 00:46:20

问题


After some changes in my repo and deploy to heroku I am receiving the following error:

ImportError: No module named site

I not have idea what can cause the problem because I only change some Django templates in the last 2 commits.

Best Regards


回答1:


Take a look at your Procfile. It should show something like this:

web: gunicorn site:app

Make sure site is the name of your app.




回答2:


I just had a very similar issue which I was able to solve. Maybe it is the same problem?

Heroku app crashed after pushing small change. Very confused




回答3:


Heroku has an article for this: https://help.heroku.com/BWJ7QYTF/why-am-i-seeing-importerror-no-module-named-site-when-deploying-a-python-app

Updates to the Python buildpack mean that the PYTHONPATH and PYTHONHOME config vars being set on the app may introduce this issue.

Firstly, check if these are present with

heroku config

To fix the issue, you can unset them like so:

heroku config:unset PYTHONHOME -a appname

heroku config:unset PYTHONPATH -a appname



来源:https://stackoverflow.com/questions/12703388/heroku-importerror-no-module-named-site

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!