Skip to content

reflex-django

You keep Django. You add a reactive UI in Python.

PyPI Python License

What is reflex-django?

reflex-django connects Django and Reflex so you run one app, not two servers you glue together by hand. Django owns your database, admin, session auth, and REST or API routes. Reflex owns reactive pages you write in Python.

Install the plugin, set profile: "integrated" in rxconfig.py, and run reflex run. Django admin, your API, and Reflex pages share cookies and sessions. Handlers on Django-aware state (AppState, ModelState, or DjangoUserState) see self.request.user when bridge is enabled and the resolved event tier binds Django context.

Install

uv add reflex-django
pip install reflex-django

For a new project, also add Django and Reflex (uv add django reflex reflex-django or pip install django reflex reflex-django). See Integration for the full layout.

Configure and run

import reflex as rx
from reflex_django.plugins import ReflexDjangoPlugin

config = rx.Config(
    app_name="shop",
    plugins=[
        ReflexDjangoPlugin(
            config={
                "settings_module": "config.settings",
                "profile": "integrated",
            }
        ),
    ],
)
  1. Add reflex_django to INSTALLED_APPS and AsyncStreamingMiddleware last (Integration)
  2. Create shop/shop.py with app = rx.App() and app.add_page(...) (Pages and state)
  3. reflex django migrate then reflex runhttp://localhost:3000/

Learn step by step

Need serializers, auth pages, deploy help, security guidance, or migration notes? See Advanced.

For AI-assisted work, use the repository llm.txt guide as the compact source map.