# reflex-django - LLM and agent guide (v4)

Plugin-only integration: `ReflexDjangoPlugin` in `rxconfig.py`, `reflex run` / `reflex export`, Django-only `settings.py`.

## Metadata

| Item | Value |
|------|--------|
| Package | reflex-django (import: reflex_django) |
| Version | 4.0+ |
| Dev | reflex run (Vite :3000 + backend :8000, Django mounted in-process) |
| Build | reflex export |
| Django tasks | reflex django migrate or manage.py |

## Setup checklist

1. uv add django reflex reflex-django
2. rxconfig.py with rx.Config and ReflexDjangoPlugin
3. {app_name}/{app_name}.py with app = rx.App()
4. settings.py: reflex_django in INSTALLED_APPS, AsyncStreamingMiddleware last
5. urls.py: import page modules for @page
6. asgi.py: get_asgi_application()
7. reflex django migrate && reflex run

## ReflexDjangoPlugin config (only these keys)

- settings_module
- django_prefix
- mount_prefix
- auto_mount

## Removed in v4 (do not use)

- RX_CONFIG, RX_PLUGINS in settings
- from reflex_django import app
- manage.py run_reflex, export_reflex
- IntegrationMode, django-first bootstrap

## Public imports

from reflex_django import configure_django, create_app, django_cli, build_django_asgi
from reflex_django.plugins import ReflexDjangoPlugin
from reflex_django.pages.decorators import page
from reflex_django.states import AppState

## Docs

- docs/getting-started/existing_reflex_project_plugin.md
- docs/reference/migration/v4_plugin_only.md
- Pre-v4 notes: docs/_archive/migration/ (not published)
