mirror of
https://github.com/Alexander-D-Karpov/akarpov
synced 2025-07-15 00:12:17 +03:00
Remove main entrypoint in favor of uvicorn command
This commit is contained in:
parent
c15df62c17
commit
52bc034fe3
|
@ -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()
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
from typing import Annotated
|
from typing import Annotated
|
||||||
|
|
||||||
import django
|
import django
|
||||||
|
@ -10,6 +11,7 @@
|
||||||
from redirect.db.dependency import get_db
|
from redirect.db.dependency import get_db
|
||||||
|
|
||||||
|
|
||||||
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
||||||
django.setup()
|
django.setup()
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user