title: Trouble Migrating database schema to Heroku (Postgres)
body: <p>I have everything set up in my local environment and the code for my website up on the Heroku server, I'm just having serious trouble getting the schema to migrate to the PostgreSQL database on the Heroku server. Whenever I attempt <code>heroku run python manage.py migrate</code> I get the following (this would be an initial migration):</p>
  
  <pre><code>    Running python manage.py migrate on baseballstatview... up, run.1653      (Free)
      Operations to perform:
      Apply all migrations: admin, auth, contenttypes, sessions, statview
      Running migrations:
        Applying contenttypes.0001_initial... OK
        Applying auth.0001_initial... OK
        Applying admin.0001_initial... OK
        Applying admin.0002_logentry_remove_auto_add... OK
        Applying contenttypes.0002_remove_content_type_name... OK
        Applying auth.0002_alter_permission_name_max_length... OK
        Applying auth.0003_alter_user_email_max_length... OK
        Applying auth.0004_alter_user_username_opts... OK
        Applying auth.0005_alter_user_last_login_null... OK
        Applying auth.0006_require_contenttypes_0002... OK
        Applying auth.0007_alter_validators_add_error_messages... OK
        Applying auth.0008_alter_user_username_max_length... OK
        Applying sessions.0001_initial... OK
        Applying statview.0001_initial... OK
  </code></pre>
  
  <p>Which seems fine but then using <code>heroku pg:info</code> it tells me I have 0 tables, and even further when I run <code>heroku run python manage.py showmigrations</code> this is what I get:</p>
  
  <pre><code>    Running python manage.py showmigrations on baseballstatview... up, run.5059 (Free)
      admin
       [ ] 0001_initial
       [ ] 0002_logentry_remove_auto_add
      auth
       [ ] 0001_initial
       [ ] 0002_alter_permission_name_max_length
       [ ] 0003_alter_user_email_max_length
       [ ] 0004_alter_user_username_opts
       [ ] 0005_alter_user_last_login_null
       [ ] 0006_require_contenttypes_0002
       [ ] 0007_alter_validators_add_error_messages
       [ ] 0008_alter_user_username_max_length
      contenttypes
       [ ] 0001_initial
       [ ] 0002_remove_content_type_name
      sessions
       [ ] 0001_initial
      statview
       [ ] 0001_initial
  </code></pre>
  
  <p>So it appears that the migrations are not going through and I'm wondering why that's the case. The database is empty, I've tried resetting it and trying again but nothing seems to work.</p>
  
  <p>EDIT: below is the relevant <code>settings.py</code>for dj_database_url:</p>
  
  <pre><code>DATABASES = {
  'default': {
      'ENGINE': 'django.db.backends.postgresql_psycopg2',
      'NAME': 'mlb_data',
      'USER': 'postgres',
      'PASSWORD': 'pw',
      'HOST': 'localhost',
      'PORT': '5432',
   }
  }
  
  import dj_database_url
  
  DATABASES['default'] = dj_database_url.config()
  
  SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  
  ALLOWED_HOSTS = ['*']
  
  DEBUG = False
  
  try:
      from .local_settings import *
  except ImportError:
      pass
  </code></pre>