Skip to content

Commit 52580cf

Browse files
chore(release): v1.0.1 — minimal install + sidebar contrast (#566)
Polish release. See PR for details. Closes #556.
1 parent ff7a748 commit 52580cf

5 files changed

Lines changed: 43 additions & 17 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ your `ModelAdmin` classes drive everything. No React code on your side.
99
INSTALLED_APPS = [
1010
# ...
1111
"django.contrib.admin",
12-
"django_admin_rest_api", # the JSON REST API (sibling package — pulled in as a dependency)
13-
"django_admin_react", # this package — the React SPA on top of it
12+
"django_admin_react", # the React SPA — includes the JSON API for you
1413
]
1514

1615
# urls.py
1716
urlpatterns = [
1817
path("admin/", admin.site.urls),
19-
path("admin-react/", include("django_admin_react.urls")), # SPA + its API include
18+
path("admin-react/", include("django_admin_react.urls")), # SPA + API in one include
2019
]
2120
```
2221

22+
**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.)
23+
2324
> **Beta — v1.0.0.** Available on PyPI; the SPA + the API
2425
> ([`django-admin-rest-api`](https://pypi.org/project/django-admin-rest-api/))
2526
> + the MCP adapter

django_admin_react/__init__.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1-
"""django-admin-react — a React single-page admin for Django.
1+
"""django-admin-react — the React SPA super-layer for the Django admin.
22
3-
The actual implementation lands across PRs #2-#7. This package is
4-
currently a skeleton that defines the layout and the Django AppConfig
5-
entry point only. See `ARCHITECTURE.md` for the design contract.
3+
A drop-in single-page admin: same `pip install`, same `INSTALLED_APPS`,
4+
same `urls.py include()` — and your `ModelAdmin` classes drive everything.
5+
The JSON wire surface lives in the sibling
6+
[`django-admin-rest-api`](https://pypi.org/project/django-admin-rest-api/)
7+
package (pulled in as a dependency); the MCP exposure of the same surface
8+
lives in
9+
[`django-admin-mcp-api`](https://pypi.org/project/django-admin-mcp-api/).
10+
11+
See `README.md` for install + the consumer wiring, and `ARCHITECTURE.md`
12+
for what lives in this repo vs. the API / MCP siblings.
613
"""
714

8-
__version__ = "0.0.0"
15+
from importlib.metadata import PackageNotFoundError
16+
from importlib.metadata import version as _pkg_version
17+
18+
try:
19+
# Read the version directly from the installed distribution metadata
20+
# so this constant never drifts from `pyproject.toml` after a release.
21+
__version__ = _pkg_version("django-admin-react")
22+
except PackageNotFoundError: # pragma: no cover — editable / source install
23+
__version__ = "0.0.0"
924

1025
default_app_config = "django_admin_react.apps.DjangoAdminReactConfig"

frontend/packages/sidebar/src/Sidebar.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ export function Sidebar() {
252252
}}
253253
placeholder="Filter models…"
254254
aria-label="Filter models"
255-
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"
255+
// Bumped one step lighter than the sidebar surface (bg-gray-900)
256+
// so the input reads as a distinct field, not as part of the
257+
// sidebar (#556). `bg-gray-700` + `border-gray-600` gives the
258+
// same two-step contrast the rest of the app's inputs have.
259+
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"
256260
/>
257261
</div>
258262
)}
@@ -262,8 +266,10 @@ export function Sidebar() {
262266
grouped-nav style. */}
263267
{/* `border-t` draws the line above the FIRST section (the filter
264268
field sits above it); `divide-y` handles the lines between the
265-
rest. */}
266-
<nav className="border-t border-gray-800 divide-y divide-gray-800">
269+
rest. `gray-700` (one step lighter than `gray-800`, which was
270+
indistinguishable from the `gray-900` sidebar surface) so the
271+
line is actually visible (#556). */}
272+
<nav className="border-t border-gray-700 divide-y divide-gray-700">
267273
{visibleApps.map((app) => {
268274
// While a filter query is active, force every group open so
269275
// matches are never hidden behind a collapsed section.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-admin-react"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "A drop-in React single-page admin for Django, driven entirely by ModelAdmin."
55
authors = ["django-admin-react contributors"]
66
license = "MIT"

tests/test_project/settings.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@
2323
"django.contrib.sessions",
2424
"django.contrib.messages",
2525
"django.contrib.staticfiles",
26-
# The JSON REST API surface (sibling package — implements every
27-
# `/api/v1/...` endpoint). `django_admin_react.urls` includes its
28-
# URLs at the same `api/v1/` prefix the SPA already expects.
29-
"django_admin_rest_api",
30-
# This package — the React SPA super-layer.
26+
# **Minimal plug-and-play (#564 owner directive 2026-05-28):** only
27+
# `django_admin_react` is registered. `pip install django-admin-react`
28+
# transitively pulls in `django-admin-rest-api`; the URL include in
29+
# `django_admin_react.urls` mounts the API at `<mount>/api/v1/`, so
30+
# the API package does not need its own `INSTALLED_APPS` entry — the
31+
# endpoints resolve through `include("django_admin_rest_api.api.urls")`
32+
# without the AppConfig being registered (the API ships zero models +
33+
# zero signals, so the registration adds nothing the URL include needs).
34+
# Test-suite parity with the README's recommended snippet.
3135
"django_admin_react",
3236
# Test-only app with a FileField model retained for back-compat
3337
# (the package's own suite owns the upload tests now).

0 commit comments

Comments
 (0)