Marcin Kuzminski committed c86decb

fixed #30 and some other issues with pylons template

Comments (0)

Files changed (1)


 from alembic import context
 from paste.deploy import loadapp
-import logging
+from logging.config import fileConfig
     # if pylons app already in, don't create a new app
     from pylons import config as pylons_config
+    config = context.config
     # can use config['__file__'] here, i.e. the Pylons
     # ini file, instead of alembic.ini
     config_file = config.get_main_option('pylons_config_file')
-    config_file = config.config_file_name
-    logging.config.fileConfig(config_file)
+    fileConfig(config_file)
     wsgi_app = loadapp('config:%s' % config_file, relative_to='.')
 # customize this section for non-standard engine configurations.
-meta = __import__("%s.model.meta" % config['pylons.package']).model.meta
+meta = __import__("%s.model.meta" % wsgi_app.config['pylons.package']).model.meta
 # add your model's MetaData object here
 # for 'autogenerate' support
 # target_metadata = mymodel.Base.metadata
 target_metadata = None
 def run_migrations_offline():
     """Run migrations in 'offline' mode.
     and not an Engine, though an Engine is acceptable
     here as well.  By skipping the Engine creation
     we don't even need a DBAPI to be available.
     Calls to context.execute() here emit the given string to the
     script output.
     with context.begin_transaction():
 def run_migrations_online():
     """Run migrations in 'online' mode.
     In this scenario we need to create an Engine
     and associate a connection with the context.
     connection = meta.engine.connect()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.