Skip to content

Commit a280363

Browse files
committed
sqlalchemy initdb before flask
1 parent 2987eea commit a280363

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,10 @@ ENV/
9999

100100
# mypy
101101
.mypy_cache/
102+
103+
#log
104+
/log
105+
.log
106+
107+
#db
108+
.db

flask/sample/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ def post_content():
7575
db_session.commit()
7676
return redirect(url_for('all_users'))
7777

78+
#
79+
init_db()
7880
if __name__ == "__main__":
81+
#init_db() #=>in here can't create tables!!
7982
app.debug = True
80-
app.run(host = '0.0.0.0') # can access from anywhere
83+
app.run(host = '0.0.0.0') # can access from anywhere

flask/sample/samples.db

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)