title: Alembic Migrations for Flask
body: <p>I have been trying to get the Alembic migration system configured for my Flask app for the past 7 hours with no success. Any ideas as to what I am doing wrong?</p>
  
  <p>I have tried all the solutions I found here, but they did not seem to work for me.</p>
  
  <pre><code>I get the following error after running the commands:
  $ heroku run alembic revision -m "please work" --autogenerate
  Running `alembic revision -m please work --autogenerate` attached to terminal... up, run.6050
  Traceback (most recent call last):
    File "/app/.heroku/python/bin/alembic", line 9, in &lt;module&gt;
      load_entry_point('alembic==0.5.0', 'console_scripts', 'alembic')()
    File "/app/.heroku/python/lib/python2.7/site-packages/pkg_resources.py", line 337, in load_entry_point
      return get_distribution(dist).load_entry_point(group, name)
    File "/app/.heroku/python/lib/python2.7/site-packages/pkg_resources.py", line 2281, in load_entry_point
      return ep.load()
    File "/app/.heroku/python/lib/python2.7/site-packages/pkg_resources.py", line 1991, in load
      entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  </code></pre>
  
  <p><strong>ImportError: No module named config</strong></p>
  
  <p>Also, note, I am trying to get it to work on Heroku</p>
  
  <p>A portion of my env.py file:</p>
  
  <pre><code>from alembic import context
  config = context.config
  </code></pre>
  
  <p>I'd appreciate any help I can get, or maybe suggestions to a simpler solution for easy migrations with Flask.</p>
  
  <p>Thanks.</p>
  
  <hr>
  
  <p>This is how I add a migration on Heroku. Is this correct?</p>
  
  <pre><code>heroku run alembic revision -m "add Content table" --autogenerate
  </code></pre>