Skip to content

Getting a blank page when loading /admin in litestar. #380

Closed Answered by sinisaos
AmazingAkai asked this question in Q&A
Discussion options

You must be logged in to vote

At the end of the url there should be a trailing slash like this http://localhost:8000/admin/, because http://localhost:8000/admin without a trailing slash doesn't work. @AmazingAkai here and here is an example of using Litestar with Piccolo. Mounting Piccolo Admin to Litestar is like this

from litestar import Litestar, asgi,
from litestar.types import Receive, Scope, Send
from piccolo_admin.endpoints import create_admin

# mounting Piccolo Admin
@asgi("/admin/", is_mount=True)
async def admin(
    scope: "Scope", receive: "Receive", send: "Send"  # noqa: F821
) -> None:
    await create_admin(tables=[YourTables])(
        scope, receive, send
    )

app = Litestar(
    route_handlers=[admin

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@sinisaos
Comment options

Answer selected by AmazingAkai
@dantownsend
Comment options

@AmazingAkai
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants