Heroku Python/Django applications all simultaneously developed ImportError

限于喜欢 提交于 2019-12-05 01:42:49

When deploying your application, if at runtime the updated python-2.7.7 is not being used.

Try purging the repo cache.

Install this: heroku plugins:install https://github.com/heroku/heroku-repo.git

Then run this command: heroku repo:purge_cache -a appname

Then deploy your application.

More info here: Heroku-repo

Add runtime.txt with python-2.7.7 to your project root and redeploy.

Heroku has just updated the runtime to python-2.7.7. This article was updated yesterday: https://devcenter.heroku.com/articles/python-runtimes

[EDITED]: This forces Heroku to rebuild the virtualenv from scratch. You can specify any runtime.

Are you using the default Python buildpack? Heroku is in the process of updating the Stack image, and especially if you're not using a current buildpack, there may be incompatibilities.

To see if you're using a default buildpack, run

$ heroku config | grep BUILDPACK_URL

Please contact Heroku support if you think this might be the cause.

I had the same thing happen to my heroku app, and after trying a million things I ended up fixing it by upgrading all of my packages including django, adding the wsgi.py file according to the django/heroku tutorial, and changing my procfile to this:

web: gunicorn app.wsgi --pythonpath app --log-file - 

The pythonpath setting is important because I had a ton of import errors and internal server errors because gunicorn no longer had the right path to my app.

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