websetup.py
23 lines
| 646 B
| text/x-python
|
PythonLexer
/ pylons_app / websetup.py
Marcin Kuzminski
|
r0 | """Setup the pylons_app application""" | ||
r327 | ||||
from os.path import dirname as dn, join as jn | ||||
from pylons_app.config.environment import load_environment | ||||
from pylons_app.lib.db_manage import DbManage | ||||
Marcin Kuzminski
|
r0 | import logging | ||
r327 | import os | |||
import sys | ||||
Marcin Kuzminski
|
r0 | log = logging.getLogger(__name__) | ||
r327 | ROOT = dn(dn(os.path.realpath(__file__))) | |||
sys.path.append(ROOT) | ||||
Marcin Kuzminski
|
r0 | def setup_app(command, conf, vars): | ||
"""Place any commands to setup pylons_app here""" | ||||
r327 | dbmanage = DbManage(log_sql=True) | |||
dbmanage.create_tables(override=True) | ||||
r341 | dbmanage.config_prompt() | |||
r327 | dbmanage.admin_prompt() | |||
dbmanage.create_permissions() | ||||
Marcin Kuzminski
|
r0 | load_environment(conf.global_conf, conf.local_conf) | ||
r327 | ||||