Mercurial > kallithea
annotate pylons_app/websetup.py @ 367:a26f48ad7a8a
fixes issue #16 reimplementation of database repository, for using generic pk instead of repo naming as pk. Which caused to many problems.
Fixed issue when redirecting after repo name change to 404.
Removed update hook from basic app setup
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 27 Jul 2010 14:53:22 +0200 |
parents | ec7b76d4bda4 |
children | 3ed2d46a2ca7 |
rev | line source |
---|---|
0 | 1 """Setup the pylons_app application""" |
327
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
2 |
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
3 from os.path import dirname as dn, join as jn |
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
4 from pylons_app.config.environment import load_environment |
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
5 from pylons_app.lib.db_manage import DbManage |
0 | 6 import logging |
327
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
7 import os |
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
8 import sys |
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
9 |
0 | 10 log = logging.getLogger(__name__) |
11 | |
327
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
12 ROOT = dn(dn(os.path.realpath(__file__))) |
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
13 sys.path.append(ROOT) |
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
14 |
0 | 15 def setup_app(command, conf, vars): |
16 """Place any commands to setup pylons_app here""" | |
327
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
17 dbmanage = DbManage(log_sql=True) |
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
18 dbmanage.create_tables(override=True) |
341
1ef52a70f3b7
Made config file free configuration based on database and capable of beeing manage via application settings + some code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents:
327
diff
changeset
|
19 dbmanage.config_prompt() |
327
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
20 dbmanage.admin_prompt() |
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
21 dbmanage.create_permissions() |
365
ec7b76d4bda4
Added initial query skipp when seting up the app.
Marcin Kuzminski <marcin@python-works.com>
parents:
341
diff
changeset
|
22 load_environment(conf.global_conf, conf.local_conf, initial=True) |
327
0e87466a117e
updated installation instruction, made more user friendly way of creating all needed configs. All is done now from paster setup-app
Marcin Kuzminski <marcin@python-works.com>
parents:
0
diff
changeset
|
23 |