A
A
Alibaba20182019-08-29 23:04:33
Django
Alibaba2018, 2019-08-29 23:04:33

Can't deploy Heroku?

I can't deploy Heroku
ModuleNotFoundError: No module named 'ml.wsgi' I've been struggling
with the same issue for 3 days and still can't figure out where the error is:
1.
── ml # repo root
└── ml #
└└── bin/ include/lib #i.e. virtual machine files
└── mysite
└└── staticfiles
└└── db.sqlite3
└└── manage.py
└└── wsgi.py
└└── Procfile └└──
myapp
└└└── templates
└ └── mysite
└└└── settings.py
└└└── static
└└└── urls.py
└└└── __init__.py
└── requirements.txt
2. This is what the Procfile looks like now:
web: gunicorn ml.wsgi I tried to change to mysite
and adding --log-file at the end - the
error does not disappear application = get_wsgi_application() 4. settings.py: WSGI_APPLICATION = 'mysite.wsgi.application' 5. requirements.txt: certifi==2019.6.16
chardet==3.0.4
dj-database-url==0.5.0
django==2.2.2
django-heroku==0.3.1
gunicorn==19.9.0
heroku==0.1.4
idna==2.8
psycopg2==2.7 .7
python-dateutil==1.5
pytz==2019.1
requests==2.22.0
sqlparse==0.3.0
urllib3==1.25.3
whitenoise==4.1.3
gunicorn==19.9.0
pytz==2019.1
sqlparse==0.3 .0
6. also tried to add in settings.py:
import django_heroku
and
django_heroku.settings(locals())
as described on the heroku website in previous versions of the settings (there are no such instructions now), but then when git push heroku master, app does not Deploying
Now Dashboard Heroku shows:
Deployed and
Build succeeded
7. I also tried to change the storage location of the Procfile from the main ml project folder to mysite, where it is stored now...
Initially I tried to use the following video for deployment'a:
https://www.youtube.com/watch? v=6DI_7Zja8Zc&t=415s
i.e. I get to 24.30, where django starts deploying for him, while mine is endless:
Application error
heroku logs --tail
ModuleNotFoundError: No module named 'ml.wsgi'

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alibaba2018, 2019-09-12
@Alibaba2018

The architecture of django was completely written incorrectly, respectively, all paths looked in the wrong place.
I had to rewrite and everything worked.

W
werevolff, 2019-08-30
@werevolff

Try adding the project root to PYTHONPATH ( solution1 , solution2 )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question