How to solve "table "auth_permission" already exists" error when the database is shared among two Django projects
<p>in <a href="http://stackoverflow.com/questions/39774580/how-to-make-two-django-projects-share-the-same-database/39781404?noredirect=1#comment66877315_39781404">this</a> question I learned how to make two Django projects use the same database.
  I have:</p>

<pre><code>projects
  project_1
    settings.py
    ...
  project_2
    settings.py
    ...
</code></pre>

<p>and</p>

<pre><code># project_1/settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(PROJECT_ROOT, 'development.db'),
    },
}


# project_2/settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(
            os.path.dirname(os.path.dirname(PROJECT_ROOT)),
            'project_1',
            'development.db'
        ),
    },
}
</code></pre>

<p>In <code>project_2/</code>, when I run:</p>

<pre><code>python manage.py syncdb
</code></pre>

<p>I get:</p>

<pre><code>django.db.utils.OperationalError: table "auth_permission" already exists
</code></pre>

<p>I guess this happens because python fails in trying to add <code>project_2</code> tables that already exists in the shared db.</p>

<p>How can I add to the shared db only those <code>project_2</code> tables not already existing in the common database?</p>

<p><strong>EDIT:</strong>
After telling project_2/ to use project_1/ db, I run the <code>syncdb</code> and get the existing table error. I do  not have a migration file.
 Shall I run a different command before syncing?</p>

<p>You can open the <code>migrations</code> file and comment out the SQL that tries to create the table. 
Then run migrations again.</p>

<p>(another possibility would be to delete the table in the database, but you'd lose the data in the table.)</p>

python django