forked from openstack-infra/lodgeit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.py
executable file
·36 lines (27 loc) · 918 Bytes
/
manage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python
from werkzeug import script, create_environ, run_wsgi_app
from lodgeit import local
from lodgeit.application import make_app
from lodgeit.database import db
dburi = 'sqlite:////tmp/lodgeit.db'
SECRET_KEY = 'no secret key'
def run_app(app, path='/'):
env = create_environ(path, SECRET_KEY)
return run_wsgi_app(app, env)
action_runserver = script.make_runserver(
lambda: make_app(dburi, SECRET_KEY, debug=True),
use_reloader=True)
action_shell = script.make_shell(
lambda: {
'app': make_app(dburi, SECRET_KEY, False, True),
'local': local,
'db': db,
'run_app': run_app
},
('\nWelcome to the interactive shell environment of LodgeIt!\n'
'\n'
'You can use the following predefined objects: app, local, db.\n'
'To run the application (creates a request) use *run_app*.')
)
if __name__ == '__main__':
script.run()