I'm trying to deploy a site I made using Django to Heroku. Heroku says it's deploying but when I try to view it says "Application Error" and when I check my logs I'm seeing "ImportError: No module named restroomrater.wsgi".
Procfile
web: gunicorn restroomrater.wsgi --log-file -
requirements.txt
asgiref==3.2.10
cachetools==4.1.1
certifi==2020.6.20
chardet==3.0.4
dj-database-url==0.5.0
Django==3.0.8
django-heroku==0.3.1
django-storages==1.9.1
django-widget-tweaks==1.4.8
google-api-core==1.21.0
google-auth==1.19.0
google-cloud-core==1.3.0
google-cloud-storage==1.29.0
google-resumable-media==0.5.1
googleapis-common-protos==1.52.0
gunicorn==20.0.4
idna==2.10
protobuf==3.12.2
psycopg2==2.8.5
pyasn1==0.4.8
pyasn1-modules==0.2.8
pytz==2020.1
requests==2.24.0
rsa==4.6
six==1.15.0
sqlparse==0.3.1
urllib3==1.25.9
whitenoise==5.1.0
structure Structure <sorry, not sure how to get text version of the structure.
Everything I've looked up points to this being problem but I'm not sure what I'm doing wrong? "restroomrater" is the name of my app. Let me know if there's more info I can provide.
Your Procfile is wrong.
web: uvicorn config.asgi:application --host 0.0.0.0 --port $PORT --workers $WEB_CONCURRENCY
config
in my example is the name of the Django app. asgi
is the name of asgi.py file, and application
is the instance within that file. For gunicorn it's similar, but with wsgi.py.
Might be appname.wsgi.application
, with the dot. I recommend uvicorn though for Django 3.
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.