简体   繁体   中英

Deploying to Heroku: ImportError:Couldn't import Django

When I want to deploy my code to Heroku using git push heroku master I have ImportError:Couldn't import Django . So I try python manage.py runserver to see what is going on and it shows this in the terminal. Full description of ImportError:Couldn't import Django . Before I tab all the process for deploying my code to Heroku, python manage.py runserver works well (the system gives me a link to open my Web page).

Here is my requirements.txt requirements.txt

Usually, when you deploy a python app to Heroku, you must have a requirements.txt file. I had this same error and when I added all of my dependencies to a requirements.txt file, it all worked. Best way to do this is if you are running on a virtual environment is

pip freeze > requirements.txt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM