mirror of
https://github.com/etesync/server
synced 2024-11-25 18:28:46 +00:00
Fix Error 404 Not Found
for Static Files (#124)
After changing for FastAPI the server ignores STATIC_ROOT and STATIC_URL
This commit is contained in:
parent
ee8349d419
commit
ce70045dac
@ -4,6 +4,7 @@ from django.conf import settings
|
|||||||
from fastapi import FastAPI, Request
|
from fastapi import FastAPI, Request
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
from fastapi.middleware.trustedhost import TrustedHostMiddleware
|
from fastapi.middleware.trustedhost import TrustedHostMiddleware
|
||||||
|
from fastapi.staticfiles import StaticFiles
|
||||||
|
|
||||||
from django_etebase import app_settings
|
from django_etebase import app_settings
|
||||||
|
|
||||||
@ -74,4 +75,6 @@ def create_application(prefix="", middlewares=[]):
|
|||||||
async def custom_exception_handler(request: Request, exc: CustomHttpException):
|
async def custom_exception_handler(request: Request, exc: CustomHttpException):
|
||||||
return MsgpackResponse(status_code=exc.status_code, content=exc.as_dict)
|
return MsgpackResponse(status_code=exc.status_code, content=exc.as_dict)
|
||||||
|
|
||||||
|
app.mount(settings.STATIC_URL, StaticFiles(directory=settings.STATIC_ROOT), name="static")
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
Loading…
Reference in New Issue
Block a user