Hello, I have a question about using serverless service Azure Function to deploy django.

The code of my Azure function init.py script is as follows.
There seems to be a problem with the dango application when running the script through azure function. Can I get some advice?

import os
import sys
import azure.functions as func
from django.core.wsgi import get_wsgi_application

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, os.path.join(BASE_DIR, "dj_xrphoto"))

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dj_xrphoto.settings')
wsgi_app = get_wsgi_application()

def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse:
    
    return func.WsgiMiddleware(wsgi_app).main(req, context)