title: How to make two django projects share the same database
body: <p>I need to make two separate Django projects share the same database. In <code>project_1</code> I have models creating objects that I need to use in <code>project_2</code> (mostly images).</p>
  
  <p>The tree structure of <code>project_1_2</code> is:</p>
  
  <pre><code>project_1/
      manage.py
      settings.py
      project_1_app1/
        ...
      ...
  
  project_2/
      manage.py
      settings.py
      project_2_app1/
        ...
      ...
  </code></pre>
  
  <p>Which is the best approach?</p>
  
  <p><strong>EDIT</strong>: I'm using sqlite3 in my development environment.</p>
  
  <p>I'd like to keep my two django projects as stand-alone projects (so that both can be upgraded safely from their respective repositories). </p>
  
  <pre><code># in project_1/settings.py
  import os
  
  PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
  ..
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(PROJECT_ROOT, 'development.db'),
      },
  }
  ...
  # in project_2/settings.py
  import os
  
  PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
  ..
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(PROJECT_ROOT, 'development.db'),
      },
  }
  ...
  </code></pre>
  
  <p>In this way, each project has its own <code>development.db</code> (the one that I need to be shared):</p>
  
  <pre><code>project_1/development.db 
  project_2/development.db
  </code></pre>
  
  <p>but I guess I need to do something more to make it shared (and unique).
  The best for me would be to keep the <code>development.db</code> at <em>project_1/ path</em> and thus set the <em>project_2/settings.py</em> <code>DATABASES</code> to point to <em>project_1/development.db</em>.</p>