I am attempting to use Django + Heroku + all necessary dependencies to create my app.
After following these steps :
migrating an existing django project
However I keep getting this error when I ran python3 manage.py runserver
:
import dj_database_url ImportError: No module named 'dj_database_url'
I have tried to fix it with these instructions and this
THIS is my code :
I imported the dj-database-url
import dj_database_url
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
I added the follow STATIC assets necessitities
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
STATIC_URL = '/static/'
# Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
os.path.join(PROJECT_ROOT, 'static'),
)
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
THIS is in my requirements.txt file
dj-database-url==0.4.2
gunicorn==19.7.1
whitenoise==3.3.0
I am still getting the ImportError
. How do I fix this?