Skip to content

Commit 404a05c

Browse files
committed
Adds wsgi for uwsgi execution.
1 parent ec0041f commit 404a05c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

apps/py/ch07_web/wsgi.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from guitary.app import app
2+

apps/py/ch08_db/guitary/app.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,18 @@ def guitars(style: str = None):
2424
return flask.render_template('guitars.html', guitars=guitar_list)
2525

2626

27-
def main():
27+
def configure():
2828
session_factory.global_init('guitary.sqlite')
2929
session_factory.create_tables()
3030
data_loader.load_guitars_if_empty()
3131

32+
33+
def main():
34+
configure()
3235
app.run(debug=True)
3336

3437

3538
if __name__ == '__main__':
3639
main()
40+
else:
41+
configure()

0 commit comments

Comments
 (0)