askrobots / dbbasic-examples
Public
Example DBBasic apps (an API, a blog and a microblog) and a template for new DBBasic modules.
danq9
Add official module template for creating DBBasic packages
17cf88a
1 year, 1 month ago
History
manage.py · 485 bytes · 19 lines
| 1 | #!/usr/bin/env python3 |
| 2 | import sys |
| 3 | import os |
| 4 | import uvicorn |
| 5 | |
| 6 | if __name__ == '__main__': |
| 7 | # Run uvicorn directly with dbbasic-web's ASGI app |
| 8 | # The settings module will detect the api/ directory and use it |
| 9 | host = os.getenv("HOST", "0.0.0.0") |
| 10 | port = int(os.getenv("PORT", "8000")) |
| 11 | |
| 12 | print(f"Starting blog on http://{host}:{port}") |
| 13 | uvicorn.run( |
| 14 | "dbbasic_web.asgi:app", |
| 15 | host=host, |
| 16 | port=port, |
| 17 | reload=True, |
| 18 | log_level="info", |
| 19 | ) |