Profiles¶
Profiles are presets for the four integration pillars in ReflexDjangoPlugin. Pick a profile in rxconfig.py instead of tuning embed, mount, proxy, and bridge by hand. Explicit pillar blocks always override profile defaults.
Pillar details: Embed · Mount · Proxy · Bridge
Comparison¶
| Profile | embed | mount | proxy | bridge | Dev commands | Use when |
|---|---|---|---|---|---|---|
integrated (default) |
on | on | on | on | reflex run |
Most projects. One command, Django admin/API in the Reflex backend. |
split_dev |
off | on | on | on | runserver + reflex run |
Debug Django with normal runserver, or Django already runs elsewhere. |
reflex_only |
off | off | on | off | reflex run |
Reflex UI only. No Django HTTP embedding, mount, or event bridge. |
{: .rd-pillar-table }
Browse http://localhost:3000/ in all profiles when proxy is on. Default ports: Vite 3000, Reflex backend 8000.
Profile presets¶
Default
integrated¶
Default for new projects. Embed runs Django HTTP inside the Reflex backend. Mount adds the SPA catch-all. Proxy wires Vite to the backend. Bridge binds Django request context to Reflex events.
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",
}
),
],
)
Use integrated when you want the simplest local workflow and a single integrated production stack (reflex run --env prod or Reflex deploy). See Deploy.
Split dev
split_dev¶
Django runs in a separate HTTP process. Vite still serves the Reflex UI on port 3000. Admin and API traffic go to your Django server through proxy.server.
import reflex as rx
from reflex_django.plugins import ReflexDjangoPlugin
config = rx.Config(
app_name="shop",
plugins=[
ReflexDjangoPlugin(
config={
"settings_module": "config.settings",
"profile": "split_dev",
"proxy": {"server": "http://127.0.0.1:8000"},
}
),
],
)
proxy.server is required at runtime when embed is off. You can also set RX_PROXY_SERVER in Django settings or the environment, but explicit profile: "split_dev" plus proxy.server is clearer for new projects.
Use split dev when you want independent Django and Reflex reload cycles, or when another service already owns Django HTTP.
UI only
reflex_only¶
Reflex UI development without Django HTTP embedding, automatic mount, or the event bridge. Proxy stays on for normal Vite dev wiring.
import reflex as rx
from reflex_django.plugins import ReflexDjangoPlugin
config = rx.Config(
app_name="shop",
plugins=[
ReflexDjangoPlugin(
config={
"settings_module": "config.settings",
"profile": "reflex_only",
}
),
],
)
Use reflex_only when you are prototyping Reflex UI only, or when Django integration is wired manually outside the default pillars.
Handlers will not receive self.request or current_request() because bridge is off. Re-enable bridge or switch profiles when you need Django auth in events.
Override patterns¶
Keep a profile and override individual pillars:
ReflexDjangoPlugin(config={
"settings_module": "config.settings",
"profile": "integrated",
"bridge": {"mode": "smart"},
"mount": {
"django_prefix": ("/admin", "/api", "/billing"),
},
})
| Goal | Override |
|---|---|
| Faster events on UI-only state | "bridge": {"mode": "smart"} |
| External Django in integrated profile | "embed": {"enabled": False}, "proxy": {"server": "http://127.0.0.1:8000"} |
| Explicit API/admin prefixes | "mount": {"django_prefix": ("/admin", "/api")} |
| Native Reflex two-port dev | "proxy": {"separate_dev_ports": True} |
{: .rd-pillar-table }
Legacy flat keys¶
These top-level plugin keys still work for upgrades:
| Legacy key | Maps to |
|---|---|
auto_mount |
mount.enabled |
mount_prefix |
mount.mount_prefix |
django_prefix |
mount.django_prefix |
{: .rd-pillar-table }
Prefer nested mount blocks in new projects.
Validation and warnings¶
Startup checks:
split_devwithoutproxy.server: raises a configuration error. Setproxy.serverorRX_PROXY_SERVER.embed.enabled=Truewithproxy.serverset: logs a warning. In-process Django HTTP takes precedence;proxy.serverapplies only when embed is off.bridge.enabled=False: logs a warning. Reflex events will not bind Django request context.- Invalid
bridge.mode: raises a configuration error. Allowed values:full,smart,none.
Full plugin and Django settings reference: Config reference.
Next: Embed