Spaces:
Sleeping
Sleeping
Download run_local_sqlite.py from AlishbaRehman/fullbackend: direct link, hf CLI and curl.
- Browser
- Download file 401 Bytes
-
https://huggingface.co/spaces/AlishbaRehman/fullbackend/resolve/main/run_local_sqlite.py
- Command line
-
hf download hf://spaces/AlishbaRehman/fullbackend/run_local_sqlite.py
-
curl -L -o run_local_sqlite.py https://huggingface.co/spaces/AlishbaRehman/fullbackend/resolve/main/run_local_sqlite.py
401 Bytes
| import os | |
| import subprocess | |
| import sys | |
| # Set environment variable to use SQLite instead of Neon DB | |
| os.environ['NEON_DATABASE_URL'] = '' | |
| os.environ['DATABASE_URL'] = 'sqlite:///./todo_app.db' | |
| # Now run the local server | |
| if __name__ == "__main__": | |
| import uvicorn | |
| print("Starting backend server with SQLite database...") | |
| uvicorn.run("src.main:app", host="127.0.0.1", port=8000, reload=True) |