Django 1.8 migrating local postgres database into a heroku database

399 views Asked by At

I've been stuck on this part for a while.After completing all the other steps when I enter git push heroku master, it pushes all the files but how do I migrate my local database? There are no commands for that. My settings.py file is still pointing to the local postgres database.How do I migrate this data into the heroku database?

settings.py

 DATABASES = {
   'default': {
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'NAME': 'music',                      
    'USER': '**',
    'PASSWORD': '**',
    'HOST': '127.0.0.1',
    'PORT': '5432',
   }
 }
1

There are 1 answers

0
Raja Simon On

Did you followed the heroku django tutorial. From the django-settings they are clearly mention how heroku will detect database url using dj-database-url package.

So just define this setting below your settings.py file then you are good to go.

For Importing and Exporting to heroku postgres please see this heroku-postgres-import-export