Adding dashboard code.
This commit is contained in:
@@ -4,7 +4,7 @@ from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from pathlib import Path
|
||||
|
||||
from .routers import public, profile, messages, send
|
||||
from .routers import public, profile, messages, send # dashboard removed for now
|
||||
|
||||
BASE_DIR = Path(__file__).parent.resolve()
|
||||
|
||||
@@ -14,12 +14,18 @@ app = FastAPI(
|
||||
version="0.1.0",
|
||||
)
|
||||
|
||||
# Static and templates
|
||||
app.mount("/static", StaticFiles(directory=BASE_DIR / "static"), name="static")
|
||||
# Define templates EARLY (before importing dashboard)
|
||||
templates = Jinja2Templates(directory=BASE_DIR / "templates")
|
||||
|
||||
# Static files
|
||||
app.mount("/static", StaticFiles(directory=BASE_DIR / "static"), name="static")
|
||||
|
||||
# Now safe to import dashboard (it needs templates)
|
||||
from .routers import dashboard # add this line
|
||||
|
||||
# Include routers
|
||||
app.include_router(public.router)
|
||||
app.include_router(profile.router)
|
||||
app.include_router(messages.router)
|
||||
app.include_router(send.router)
|
||||
app.include_router(send.router)
|
||||
app.include_router(dashboard.router) # now works
|
||||
Reference in New Issue
Block a user