0

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

Jessica
  • 1
  • 2
  • Make sure that your Python Path is set correctly. It seems Heroku deployment causes a lot of errors these days with the Django projects. There are a bunch of threads around. https://stackoverflow.com/questions/9462212/import-error-no-module-named-django – JSRB May 31 '20 at 20:27

1 Answers1

0

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
Dharman
  • 30,962
  • 25
  • 85
  • 135
frogsam5
  • 21
  • 6