django migrate failing after switching from sqlite3 to postgres
<p>I have been developing a Django project using sqlite3 as the backend and it has been working well. I am now attempting to switch the project over to use postgres as the backend but running into some issues.</p>

<p>After modifying my settings file, setting up postgres, creating the database and user I get the error below when running <code>manage.py migrate</code></p>

<p><code>django.db.utils.ProgrammingError: relation "financemgr_rate" does not exist</code></p>

<p><code>financemgr</code> is an app within the project. <code>rate</code> is a table within the app.</p>

<p>If I run this same command but specify sqlite3 as my backend it works fine.</p>

<p>For clarity I will repeat:</p>

<p><strong>Environment Config1</strong></p>

<ul>
<li>Ubuntu 14.04, Django 1.10</li>
<li>Settings file has <code>'ENGINE': 'django.db.backends.sqlite3'</code>

<ol>
<li>Run <code>manage.py migrate</code></li>
<li>Migration runs and processes all the migrations successfully</li>
</ol></li>
</ul>

<p><strong>Environment Config2</strong></p>

<ul>
<li>Ubuntu 14.04, Django 1.10</li>
<li>Settings file has <code>'ENGINE': 'django.db.backends.postgresql_psycopg2'</code>

<ol>
<li>Run <code>manage.py migrate</code></li>
<li>Migration runs and gives the error <code>django.db.utils.ProgrammingError: relation "financemgr_rate" does not exist</code></li>
</ol></li>
</ul>

<p>Everything else is identical. I am not trying to migrate data, just populate the schema etc.</p>

<p>Any ideas?</p>

<p>This may help you :</p>

<p>I think you have pre-stored migration files(migrate for sqlite database).
Now you have change the database configuration but still django looking for the existing table according to migration files you have(migrated for previous database). 
Better you delete all the migration files in migration folder of your app, and migrate it again, by running commands <code>python manage.py makemigrations</code> and <code>python manage.py migrate</code> it may work fine.</p>

python django postgresql django-models sqlite3