Skip to content

Commit e435fe5

Browse files
committed
Minor fix for blueprints + flask run.
1 parent e2e08ed commit e435fe5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

app/ch12-forms/final/pypi_org/app.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import sys
33
import flask
4+
45
folder = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
56
sys.path.insert(0, folder)
67

@@ -10,9 +11,13 @@
1011

1112

1213
def main():
14+
configure()
15+
app.run(debug=True)
16+
17+
18+
def configure():
1319
register_blueprints()
1420
setup_db()
15-
app.run(debug=True)
1621

1722

1823
def setup_db():
@@ -38,3 +43,5 @@ def register_blueprints():
3843

3944
if __name__ == '__main__':
4045
main()
46+
else:
47+
configure()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def try_int(text) -> int:
2+
try:
3+
return int(text)
4+
except:
5+
return 0

0 commit comments

Comments
 (0)