Spaces:
Running
Running
Update alisto_project/backend/app.py
Browse files
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 |
-
|
|
|
|
|
|
|
| 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)
|