Refactored instances management

This commit is contained in:
2025-11-23 19:52:03 +01:00
parent 97247f824c
commit b1be747101
24 changed files with 783 additions and 216 deletions

View File

@@ -10,6 +10,7 @@ from starlette.responses import Response
from myfasthtml.auth.routes import setup_auth_routes
from myfasthtml.auth.utils import create_auth_beforeware
from myfasthtml.core.AuthProxy import AuthProxy
from myfasthtml.core.instances import RootInstance
from myfasthtml.core.utils import utils_app
logger = logging.getLogger("MyFastHtml")
@@ -104,6 +105,6 @@ def create_app(daisyui: Optional[bool] = True,
setup_auth_routes(app, rt, base_url=base_url)
# create the AuthProxy instance
AuthProxy(base_url) # using the auto register mechanism to expose it
AuthProxy(RootInstance, base_url) # using the auto register mechanism to expose it
return app, rt