Django Heroku - ModuleNotFoundError: No module named 'django_heroku'

落花浮王杯 提交于 2021-01-26 09:24:48

问题


I am deploying on heroku a website but I am experiencing some issue. My project is called mysite-project.

I did the following:

1) Create a Procfile containing:

web: gunicorn mysite-project.wsgi

at the base root of my project (same level where manage.py is).

2) app/settings.py

import django_heroku at the top

django_heroku.settings(locals()) at the bottom of settings.py

3)

pip install gunicorn
pip install django-heroku
pip freeze > requirements.txt

4) If I run python manage.py runserver I get:

ModuleNotFoundError: No module named 'django_heroku'

回答1:


There was a problem with:

pip install django-heroku

It was not fully installed because thee was a problem with psycopg2 that was not installed. To install psycopg2, run:

pip install psycopg2

Then you can run pip install django-heroku and the error disappeared




回答2:


For me, the error was due to adding django-heroku to installed apps in settings.py..,removing it solved the issue.



来源:https://stackoverflow.com/questions/57416061/django-heroku-modulenotfounderror-no-module-named-django-heroku

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!