Skip to content

Commit d0b3c38

Browse files
Fix /admin route redirect and add OpenAPI/Swagger support
- Add /admin redirect route in admin router before mounting urls_router - Add OpenAPI/Swagger UI support out of the box - Fix route ordering to ensure /admin redirect works correctly - Update example apps to use Starlette instead of FastAPI
1 parent 08cda6f commit d0b3c38

File tree

16 files changed

+298
-24
lines changed

16 files changed

+298
-24
lines changed

example/apps/home/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from fastapi import APIRouter
1+
from raystack.compat import APIRouter
22

33
from .api import router as api_router
44
from .urls import router as urls_router

example/apps/home/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from fastapi import APIRouter
1+
from raystack.compat import APIRouter
22

33

44
router = APIRouter()

example/apps/home/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from fastapi import APIRouter
1+
from raystack.compat import APIRouter
22
from . import views
33

44
router = APIRouter()

example/apps/home/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from raystack.shortcuts import render_template
2-
from fastapi import Request
2+
from raystack.compat import Request
33

44
# Create your views here.
55

example/config/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from fastapi import APIRouter, Request
1+
from raystack.compat import APIRouter, Request
22

33

44
router = APIRouter()

example_async/apps/home/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from fastapi import APIRouter
1+
from raystack.compat import APIRouter
22

33
from .api import router as api_router
44
from .urls import router as urls_router

example_async/apps/home/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from fastapi import APIRouter
1+
from raystack.compat import APIRouter
22

33

44
router = APIRouter()

example_async/apps/home/deps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from fastapi import Depends
1+
from raystack.compat import Depends
22
from sqlalchemy.ext.asyncio import AsyncSession
33

44
# Use framework functionality for database operations

example_async/apps/home/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from fastapi import APIRouter
1+
from raystack.compat import APIRouter
22
from . import views
33

44
router = APIRouter()

example_async/apps/home/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from raystack.shortcuts import render_template
2-
from fastapi import Request, Depends
2+
from raystack.compat import Request, Depends
33
from sqlalchemy.ext.asyncio import AsyncSession
44
from sqlmodel import select
55

0 commit comments

Comments
 (0)