mirror of
https://github.com/etesync/server
synced 2024-12-28 02:08:08 +00:00
Mount the django application.
This commit is contained in:
parent
295ae6f3d3
commit
63afcc0830
@ -9,6 +9,7 @@ from django.conf import settings
|
||||
|
||||
# Not at the top of the file because we first need to setup django
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.middleware.wsgi import WSGIMiddleware
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.middleware.trustedhost import TrustedHostMiddleware
|
||||
|
||||
@ -37,6 +38,7 @@ app.add_middleware(
|
||||
CORSMiddleware, allow_origin_regex="https?://.*", allow_credentials=True, allow_methods=["*"], allow_headers=["*"]
|
||||
)
|
||||
app.add_middleware(TrustedHostMiddleware, allowed_hosts=settings.ALLOWED_HOSTS)
|
||||
app.mount("/", WSGIMiddleware(application))
|
||||
|
||||
|
||||
@app.exception_handler(CustomHttpException)
|
||||
|
Loading…
Reference in New Issue
Block a user