Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ your `ModelAdmin` classes drive everything. No React code on your side.
INSTALLED_APPS = [
# ...
"django.contrib.admin",
"django_admin_rest_api", # the JSON REST API (sibling package — pulled in as a dependency)
"django_admin_react", # this package — the React SPA on top of it
"django_admin_react", # the React SPA — includes the JSON API for you
]

# urls.py
urlpatterns = [
path("admin/", admin.site.urls),
path("admin-react/", include("django_admin_react.urls")), # SPA + its API include
path("admin-react/", include("django_admin_react.urls")), # SPA + API in one include
]
```

**One `INSTALLED_APPS` line + one URL include is the entire integration.** `pip install django-admin-react` transitively pulls in the [JSON API](https://pypi.org/project/django-admin-rest-api/) and the [MCP adapter](https://pypi.org/project/django-admin-mcp-api/); `django_admin_react.urls` includes the API endpoints at `<mount>/api/v1/…`, so the SPA finds its wire surface with zero configuration. (Mount the API a second time at your own prefix only if a non-SPA client also needs it.)

> **Beta — v1.0.0.** Available on PyPI; the SPA + the API
> ([`django-admin-rest-api`](https://pypi.org/project/django-admin-rest-api/))
> + the MCP adapter
Expand Down
25 changes: 20 additions & 5 deletions django_admin_react/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
"""django-admin-react — a React single-page admin for Django.
"""django-admin-react — the React SPA super-layer for the Django admin.

The actual implementation lands across PRs #2-#7. This package is
currently a skeleton that defines the layout and the Django AppConfig
entry point only. See `ARCHITECTURE.md` for the design contract.
A drop-in single-page admin: same `pip install`, same `INSTALLED_APPS`,
same `urls.py include()` — and your `ModelAdmin` classes drive everything.
The JSON wire surface lives in the sibling
[`django-admin-rest-api`](https://pypi.org/project/django-admin-rest-api/)
package (pulled in as a dependency); the MCP exposure of the same surface
lives in
[`django-admin-mcp-api`](https://pypi.org/project/django-admin-mcp-api/).

See `README.md` for install + the consumer wiring, and `ARCHITECTURE.md`
for what lives in this repo vs. the API / MCP siblings.
"""

__version__ = "0.0.0"
from importlib.metadata import PackageNotFoundError
from importlib.metadata import version as _pkg_version

try:
# Read the version directly from the installed distribution metadata
# so this constant never drifts from `pyproject.toml` after a release.
__version__ = _pkg_version("django-admin-react")
except PackageNotFoundError: # pragma: no cover — editable / source install
__version__ = "0.0.0"

default_app_config = "django_admin_react.apps.DjangoAdminReactConfig"
12 changes: 9 additions & 3 deletions frontend/packages/sidebar/src/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@ export function Sidebar() {
}}
placeholder="Filter models…"
aria-label="Filter models"
className="w-full rounded border border-gray-700 bg-gray-800 px-2 py-1 text-sm text-gray-100 placeholder-gray-500 focus:outline-none focus-visible:ring-1 focus-visible:ring-gray-500"
// Bumped one step lighter than the sidebar surface (bg-gray-900)
// so the input reads as a distinct field, not as part of the
// sidebar (#556). `bg-gray-700` + `border-gray-600` gives the
// same two-step contrast the rest of the app's inputs have.
className="w-full rounded border border-gray-600 bg-gray-700 px-2 py-1 text-sm text-gray-100 placeholder-gray-400 focus:outline-none focus-visible:ring-1 focus-visible:ring-gray-500"
/>
</div>
)}
Expand All @@ -262,8 +266,10 @@ export function Sidebar() {
grouped-nav style. */}
{/* `border-t` draws the line above the FIRST section (the filter
field sits above it); `divide-y` handles the lines between the
rest. */}
<nav className="border-t border-gray-800 divide-y divide-gray-800">
rest. `gray-700` (one step lighter than `gray-800`, which was
indistinguishable from the `gray-900` sidebar surface) so the
line is actually visible (#556). */}
<nav className="border-t border-gray-700 divide-y divide-gray-700">
{visibleApps.map((app) => {
// While a filter query is active, force every group open so
// matches are never hidden behind a collapsed section.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-admin-react"
version = "1.0.0"
version = "1.0.1"
description = "A drop-in React single-page admin for Django, driven entirely by ModelAdmin."
authors = ["django-admin-react contributors"]
license = "MIT"
Expand Down
14 changes: 9 additions & 5 deletions tests/test_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
# The JSON REST API surface (sibling package — implements every
# `/api/v1/...` endpoint). `django_admin_react.urls` includes its
# URLs at the same `api/v1/` prefix the SPA already expects.
"django_admin_rest_api",
# This package — the React SPA super-layer.
# **Minimal plug-and-play (#564 owner directive 2026-05-28):** only
# `django_admin_react` is registered. `pip install django-admin-react`
# transitively pulls in `django-admin-rest-api`; the URL include in
# `django_admin_react.urls` mounts the API at `<mount>/api/v1/`, so
# the API package does not need its own `INSTALLED_APPS` entry — the
# endpoints resolve through `include("django_admin_rest_api.api.urls")`
# without the AppConfig being registered (the API ships zero models +
# zero signals, so the registration adds nothing the URL include needs).
# Test-suite parity with the README's recommended snippet.
"django_admin_react",
# Test-only app with a FileField model retained for back-compat
# (the package's own suite owns the upload tests now).
Expand Down
Loading