0

I am trying to host my django application on heroku for the first time and i am successfully able to deploy it but i am facing an application error and is showing me this image of my heroku webpage and when i check the logs using heroku logs --tail its showing me this error log details.

In it what it shows ModuleNotFoundError: No module named 'twitter_project' here 'twitter_project' is the name of my project. I did pip install django-heroku and pip install gunicorn and imported import django_heroku at the top of settings.py and added django_heroku.settings(locals()) at the end of settings.py, added a Procfile which contains this web: gunicorn twitter_project.wsgi and the requirements.txt is also complete and have added django-heroku==0.3.1 and gunicorn==20.0.4 as well, I don't know what I am doing wrong. I don't if I have something wrong with my static files.

Here is the structure of my project

C:.
|   as.txt
|   out.doc
|   
+---twitter_project
|   |   db.sqlite3
|   |   manage.py
|   |   Procfile
|   |   requirements.txt
|   |   
|   +---home
|   |   |   admin.py
|   |   |   apps.py
|   |   |   models.py
|   |   |   tests.py
|   |   |   urls.py
|   |   |   views.py
|   |   |   __init__.py
|   |   |   
|   |   +---dash_apps
|   |   |   \---finished_apps
|   |   |       |   simpleexample.py
|   |   |       |   
|   |   |       \---__pycache__
|   |   |               simpleexample.cpython-37.pyc
|   |   |               
|   |   +---migrations
|   |   |   |   __init__.py
|   |   |   |   
|   |   |   \---__pycache__
|   |   |           __init__.cpython-37.pyc
|   |   |           
|   |   +---static
|   |   |   \---home
|   |   |       \---img
|   |   |           |   negative_dettol.png
|   |   |           |   positive_dettol.png
|   |   |           |   
|   |   |           \---bg
|   |   |                   215771.jpg
|   |   |                   q1w2e3.jpg
|   |   |                   qwer.jpg
|   |   |                   qwer1.jpg
|   |   |                   twitter-bird.jpg
|   |   |                   
|   |   +---templates
|   |   |   \---home
|   |   |           home.html
|   |   |           welcome.html
|   |   |           
|   |   \---__pycache__
|   |           admin.cpython-37.pyc
|   |           apps.cpython-37.pyc
|   |           models.cpython-37.pyc
|   |           urls.cpython-37.pyc
|   |           views.cpython-37.pyc
|   |           __init__.cpython-37.pyc
|   |           
|   +---static
|   |   +---admin
|   |   |   +---css
|   |   |   |   |   autocomplete.css
|   |   |   |   |   base.css
|   |   |   |   |   changelists.css
|   |   |   |   |   dashboard.css
|   |   |   |   |   fonts.css
|   |   |   |   |   forms.css
|   |   |   |   |   login.css
|   |   |   |   |   responsive.css
|   |  .
       .
       .
       .
       .
something like this

Here is the snippet of the installed appsinstalled apps

  • [This question](https://stackoverflow.com/questions/59930777/heroku-gunicorn-deploy-error-nomodulenameerror) might help. If you're still stuck, then [edit] your question to show the layout of your repository, including where `Procfile` and `manage.py` are located. – Alasdair Jul 15 '20 at 09:47
  • The problem is probably in the `settings.py` file. Could you kindly send a snippet of the **INSTALLED_APPS** – dun-can Jul 15 '20 at 11:11
  • Please show your `Procfile`, `manage.py` and the location of the `settings.py`. You don't need to show `__pycache__` directories or the contents of `static` directories. – Alasdair Jul 15 '20 at 15:33
  • Thank you so much @Alasdair the problem was with the Procfile – Justin Joy Jul 16 '20 at 10:25

0 Answers0