From 63afcc0830170834e59b4db17301743d3c636749 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Mon, 28 Dec 2020 11:44:17 +0200 Subject: [PATCH] Mount the django application. --- etebase_fastapi/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etebase_fastapi/app.py b/etebase_fastapi/app.py index 75cb099..6dffef4 100644 --- a/etebase_fastapi/app.py +++ b/etebase_fastapi/app.py @@ -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)