Created
December 1, 2011 20:13
-
-
Save jeanphix/1419502 to your computer and use it in GitHub Desktop.
alembic / flask-sqlalchemy (alembic/env.py)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
from alembic import context | |
from sqlalchemy import engine_from_config | |
from logging.config import fileConfig | |
sys.path.append(os.getcwd()) | |
from models import metadata | |
from myapp import app | |
config = context.config | |
config.set_main_option('sqlalchemy.url', app.config['SQLALCHEMY_DATABASE_URI']) | |
fileConfig(config.config_file_name) | |
target_metadata = metadata |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment