Django 1.8 database error deploying project on heroku

200 views Asked by At

I have a local_settings.py that contains the database settings for my local postgre database. My settings.py database looks like this.

   DATABASES = {
   'default': {
   'ENGINE': 'django.db.backends.postgresql_psycopg2',  
    'NAME': '', 
    'USER': '',
    'PASSWORD': '',
    'HOST': '', 
    'PORT': '',  
    }
   }

 ALLOWED_HOSTS = ['*']

 import dj_database_url

 DATABASES['default'] =   dj_database_url.config(default='postgres://mylocalusername:mylocalpass@OK@localhost/mylocaldb')

 SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

While deploying, after I created a new database using heroku addons:create heroku-postgresql:hobby-dev , I tried to run 'heroku run python manage.py migrate' before I could import my local database but I got the following error-

And this is the error I get.

    raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
    django.core.exceptions.ImproperlyConfigured: settings.DATABASES is   improperly configured. Please supply the ENGINE value. Check settings   documentation for moredetails.

I also tried to run the following commands after database creation.

heroko config
heroko config:add DATABASE_URL={#the database url}
0

There are 0 answers