title: Alembic not able to import flask application ORM models
body: <h2><strong>Use case:</strong></h2>
  
  <p>I'm attempting to create a migration script that will create a table (which will make a many to many relationship) and then populate that table with foreign keys from the database. </p>
  
  <p>To do this I'm attempting to load my flask applications ORM models so that I may use them in my migration script.</p>
  
  <h2><strong>directory structure</strong></h2>
  
  <pre><code>/home/alord/git/my_project/  #  project directory
  /home/alord/git/my_project/alembic_testing  #  migration directory
  /home/alord/git/my_project/my_project #requirement of flask modules
  /home/alord/git/my_project/runserver.py  #  script that starts development server
  /home/alord/git/my_project/alembic.ini  #  alembic configuration
  /home/alord/git/my_project/development_config.py  #  development server configuration
  </code></pre>
  
  <p>if I run alembic upgrade +1</p>
  
  <pre><code>import os
  print os.getcwd()
  print os.path.dirname(os.path.realpath(__file__))
  </code></pre>
  
  <p>in </p>
  
  <pre><code>/home/alord/git/my_project/alembic_testing/env.py
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>/home/alord/git/my_project
  /home/alord/git/my_project/alembic_testing
  </code></pre>
  
  <h2><strong>What I'm doing</strong></h2>
  
  <p>I'm placing </p>
  
  <pre><code>import os.path
  sys.path.append(
      os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
  import my_project
  </code></pre>
  
  <p>In my upgrade script and then running the command </p>
  
  <pre><code>alembic upgrade +1
  </code></pre>
  
  <p>and I'm recieving a stack trace with the error</p>
  
  <pre><code>ImportError: No module named my_project
  </code></pre>
  
  <p>Without this attempted import the table upgrade and downgrade functions run without error.</p>
  
  <h2><strong>What I expect</strong></h2>
  
  <p>I would like to be able to import the package, and more importantly *my_project.models* so that I can use the ORM to populate my new table.</p>
  
  <p><strong>Note:</strong>
  I can't use relative package inclusion because I'm running alembic rather than calling python. As such, the python -m argument isn't useful to me.  </p>