Run a Django backend (Django ORM, Django Admin) alongside a Reflex app.
Project description
reflex-django
Keep Django. Get a reactive UI in Python. One command, shared cookies, native Reflex dev.
Documentation · LLM guide · GitHub · PyPI
What is reflex-django?
reflex-django is a Reflex plugin that runs your Django project and Reflex UI together. You keep Django for models, admin, auth, and APIs. You build the frontend in Python with Reflex components and state.
One dev command (reflex run) starts both sides. Sessions and cookies are shared, so a user logged in through Django is logged in on Reflex pages. Event handlers on Django-aware state read self.request.user like a Django view when bridge is enabled and the resolved tier binds request context.
The plugin wires four pieces automatically (embed, mount, proxy, bridge). Set profile: "integrated" in rxconfig.py and you get port 3000 dev, SPA routing, and Django middleware on bridge-bound Reflex events.
Install
uv add reflex-django
Or with pip (you also need Django and Reflex):
pip install reflex-django django reflex
New project with uv:
uv add django reflex reflex-django
Quick start
rxconfig.py:
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",
}),
],
)
Then:
- Add
reflex_djangotoINSTALLED_APPSand putAsyncStreamingMiddlewarelast inMIDDLEWARE(full setup) - Create
shop/shop.pywithapp = rx.App()andapp.add_page(...)(pages and state) - Run
reflex django migrateandreflex run - Open http://localhost:3000/
Learn each integration piece step by step →
API guides: Serializers · Model state · Forms/FieldSpec · Live updates · Devtools · Auth · Security · Config
Commands
reflex run
reflex export
reflex django migrate
reflex django makemigrations
reflex django createsuperuser
reflex django scaffold shop.Product --output shop/product_views.py
Requirements
| Version | |
|---|---|
| reflex-django | 4.0+ |
| Python | 3.12+ |
| Django | 6.0+ |
| Reflex | >=0.9.4,<1.0 |
Author: Mohannad Irshedat · Docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reflex_django-4.0.2.tar.gz.
File metadata
- Download URL: reflex_django-4.0.2.tar.gz
- Upload date:
- Size: 249.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47cf7bb9c9f66f03f7b64c5b2f0aa678ba310e5a97c3bf92e40e502cf1c0b617
|
|
| MD5 |
33a45f9806d6a557080d7746cc44249d
|
|
| BLAKE2b-256 |
e0c76630d6b74677b73972aab183c29a260f58972b59d1cfb6606525cdbb9b9f
|
File details
Details for the file reflex_django-4.0.2-py3-none-any.whl.
File metadata
- Download URL: reflex_django-4.0.2-py3-none-any.whl
- Upload date:
- Size: 246.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bc84810fe5827ed154fa7d57c94feacdc76f1e96aebf59a9f4521cefcc6fcd6
|
|
| MD5 |
aae6e93dbdb2fba6f0849618f5a15ba6
|
|
| BLAKE2b-256 |
958bd3b00e9ab523bf801be08495701c0ed44aee3b6c10a21f4c4defce89ec91
|