Remove main entrypoint in favor of uvicorn command

This commit is contained in:
Damir Modyarov 2023-08-07 23:07:51 +03:00
parent c15df62c17
commit 52bc034fe3
2 changed files with 2 additions and 19 deletions

View File

@ -1,19 +0,0 @@
import os
import uvicorn
from redirect.settings import settings
def main():
"""Main entrypoint of the app."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
uvicorn.run(
"redirect.app:app",
host=settings.redirect_host,
port=settings.redirect_port,
reload=settings.redirect_reload
)
if __name__ == '__main__':
main()

View File

@ -1,3 +1,4 @@
import os
from typing import Annotated
import django
@ -10,6 +11,7 @@
from redirect.db.dependency import get_db
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
django.setup()
app = FastAPI()