Quivara commited on
Commit
46519b8
·
verified ·
1 Parent(s): 9282421

Update alisto_project/backend/app.py

Browse files
Files changed (1) hide show
  1. alisto_project/backend/app.py +5 -1
alisto_project/backend/app.py CHANGED
@@ -205,6 +205,10 @@ def user_status():
205
  return jsonify({"is_logged_in": False})
206
 
207
  # runs the application on host 0.0.0.0 and creates the admin user on startup
208
- if __name__ == '__main__':
 
 
209
  create_admin()
 
 
210
  app.run(debug=True, port=5000)
 
205
  return jsonify({"is_logged_in": False})
206
 
207
  # runs the application on host 0.0.0.0 and creates the admin user on startup
208
+ # NEW CODE (Runs on Cloud too)
209
+ # Create the database and admin user immediately when loaded
210
+ with app.app_context():
211
  create_admin()
212
+
213
+ if __name__ == '__main__':
214
  app.run(debug=True, port=5000)