Compare commits
No commits in common. "92dfa044073a3dd6dfb2dd68a7f134b9d5c6caf9" and "bf7af89c78cacf00b38a1eb54978344a38f5d9af" have entirely different histories.
92dfa04407
...
bf7af89c78
1 changed files with 11 additions and 0 deletions
|
@ -74,6 +74,17 @@ db.init_app(app)
|
||||||
# Initializes CORS so that the api_tool can talk to the example app
|
# Initializes CORS so that the api_tool can talk to the example app
|
||||||
cors.init_app(app)
|
cors.init_app(app)
|
||||||
|
|
||||||
|
# Add users for the example
|
||||||
|
with app.app_context():
|
||||||
|
db.create_all()
|
||||||
|
if db.session.query(User).filter_by(username='Yasoob').count() < 1:
|
||||||
|
db.session.add(User(
|
||||||
|
username='Yasoob',
|
||||||
|
password=guard.hash_password('strongpassword'),
|
||||||
|
roles='admin'
|
||||||
|
))
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/login', methods=['POST'])
|
@app.route('/api/login', methods=['POST'])
|
||||||
def login():
|
def login():
|
||||||
|
|
Loading…
Reference in a new issue