title: How to import the own model into myproject/alembic/env.py?
body: <p>I want to use <code>alembic revision --autogenerate</code> with my own model classes. Because of that I need to import them in <code>myproject/alembic/env.py</code> as <a href="http://alembic.readthedocs.org/en/latest/autogenerate.html" rel="noreferrer">described in the docs</a>. But this doesn't work even if I tried a lot of variations.</p>
  
  <p>I am not sure in which context (don't know if this is the correct word) does alembic run the <code>env.py</code>. Maybe that causes some errors.</p>
  
  <p>This is the directory and file structure I use.</p>
  
  <pre><code>myproject/
      common/
          __init__.py
          model.py
      alembic/
          env.py
  </code></pre>
  
  <p>The error is kind of that</p>
  
  <pre><code>    from .common import model
  SystemError: Parent module '' not loaded, cannot perform relative import
  </code></pre>
  
  <p><code>myproject</code> itself is just a repository/working directory. It is not <em>installed</em> into the system (with <code>pip3</code>, <code>apt-get</code>, <code>easyinstall</code> or anything else).</p>