Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Heroku - ModuleNotFoundError: No module named 'django_heroku'

Tags:

django

heroku

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'
like image 385
Magofoco Avatar asked Aug 08 '19 15:08

Magofoco


2 Answers

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

like image 61
Magofoco Avatar answered Nov 05 '22 03:11

Magofoco


I had the same problem as well. I have psycopg2 installed. (for postgres)

Installing 'psycopg2- binary' solved my problem.

like image 1
khavro Avatar answered Nov 05 '22 04:11

khavro