Spaces:
Sleeping
Sleeping
Download run_backend_with_sqlite.py from AlishbaRehman/fullbackend: direct link, hf CLI and curl.
- Browser
- Download file 539 Bytes
-
https://huggingface.co/spaces/AlishbaRehman/fullbackend/resolve/main/run_backend_with_sqlite.py
- Command line
-
hf download hf://spaces/AlishbaRehman/fullbackend/run_backend_with_sqlite.py
-
curl -L -o run_backend_with_sqlite.py https://huggingface.co/spaces/AlishbaRehman/fullbackend/resolve/main/run_backend_with_sqlite.py
539 Bytes
| import os | |
| import sys | |
| # Clear any existing DATABASE_URL environment variable to ensure it uses the .env file | |
| if 'DATABASE_URL' in os.environ: | |
| del os.environ['DATABASE_URL'] | |
| # Import settings after clearing the environment variable | |
| from src.config import settings | |
| print(f"Using DATABASE_URL: {settings.DATABASE_URL}") | |
| # Now run the server | |
| import uvicorn | |
| from src.main import app | |
| if __name__ == "__main__": | |
| uvicorn.run( | |
| app, | |
| host="127.0.0.1", | |
| port=9000, | |
| reload=False, | |
| log_level="info" | |
| ) |