django-eadmin 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- django_eadmin-0.0.1/MANIFEST.in +6 -0
- django_eadmin-0.0.1/PKG-INFO +129 -0
- django_eadmin-0.0.1/PYPI_README.md +111 -0
- django_eadmin-0.0.1/README.md +215 -0
- django_eadmin-0.0.1/THIRD_PARTY_NOTICES.md +12 -0
- django_eadmin-0.0.1/django_eadmin.egg-info/PKG-INFO +129 -0
- django_eadmin-0.0.1/django_eadmin.egg-info/SOURCES.txt +50 -0
- django_eadmin-0.0.1/django_eadmin.egg-info/dependency_links.txt +1 -0
- django_eadmin-0.0.1/django_eadmin.egg-info/requires.txt +1 -0
- django_eadmin-0.0.1/django_eadmin.egg-info/top_level.txt +1 -0
- django_eadmin-0.0.1/eadmin/__init__.py +8 -0
- django_eadmin-0.0.1/eadmin/__init__.pyi +9 -0
- django_eadmin-0.0.1/eadmin/admin.py +11 -0
- django_eadmin-0.0.1/eadmin/apps.py +12 -0
- django_eadmin-0.0.1/eadmin/context_processors.py +29 -0
- django_eadmin-0.0.1/eadmin/forms.py +196 -0
- django_eadmin-0.0.1/eadmin/permissions.py +23 -0
- django_eadmin-0.0.1/eadmin/py.typed +0 -0
- django_eadmin-0.0.1/eadmin/registry.py +167 -0
- django_eadmin-0.0.1/eadmin/static/eadmin/eadmin.css +167 -0
- django_eadmin-0.0.1/eadmin/static/eadmin/eadmin.js +22 -0
- django_eadmin-0.0.1/eadmin/static/eadmin/logo.svg +6 -0
- django_eadmin-0.0.1/eadmin/static/eadmin/vendor/LICENSE.alpinejs +21 -0
- django_eadmin-0.0.1/eadmin/static/eadmin/vendor/LICENSE.daisyui +21 -0
- django_eadmin-0.0.1/eadmin/static/eadmin/vendor/LICENSE.htmx +13 -0
- django_eadmin-0.0.1/eadmin/static/eadmin/vendor/LICENSE.tailwindcss +21 -0
- django_eadmin-0.0.1/eadmin/static/eadmin/vendor/alpinejs-3.17.4.min.js +21 -0
- django_eadmin-0.0.1/eadmin/static/eadmin/vendor/daisyui-4.12.24.min.css +20 -0
- django_eadmin-0.0.1/eadmin/static/eadmin/vendor/htmx-2.0.4.min.js +1 -0
- django_eadmin-0.0.1/eadmin/static/eadmin/vendor/tailwindcss-play-3.4.17.js +83 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/base.html +77 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/dashboard.html +5 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/login.html +61 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/model_detail.html +12 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/model_form.html +41 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/model_history.html +6 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/model_list.html +10 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/partials/object_table.html +2 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/password_form.html +6 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/widgets/autocomplete.html +11 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/widgets/datetime.html +15 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/widgets/multiselect.html +16 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/widgets/raw_id.html +4 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/widgets/select.html +17 -0
- django_eadmin-0.0.1/eadmin/templates/eadmin/widgets/transfer_select.html +66 -0
- django_eadmin-0.0.1/eadmin/templatetags/__init__.py +1 -0
- django_eadmin-0.0.1/eadmin/templatetags/eadmin.py +104 -0
- django_eadmin-0.0.1/eadmin/tests/__init__.py +1 -0
- django_eadmin-0.0.1/eadmin/urls.py +30 -0
- django_eadmin-0.0.1/eadmin/views.py +474 -0
- django_eadmin-0.0.1/pyproject.toml +31 -0
- django_eadmin-0.0.1/setup.cfg +4 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: django-eadmin
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: A reusable Tailwind, HTMX, Alpine.js, and DaisyUI Django administration app.
|
|
5
|
+
Author: EAdmin contributors
|
|
6
|
+
License-Expression: LicenseRef-Proprietary
|
|
7
|
+
Project-URL: Homepage, https://github.com/lqcodes/django-eadmin
|
|
8
|
+
Project-URL: Source, https://github.com/lqcodes/django-eadmin
|
|
9
|
+
Project-URL: Issues, https://github.com/lqcodes/django-eadmin/issues
|
|
10
|
+
Classifier: Framework :: Django
|
|
11
|
+
Classifier: Framework :: Django :: 5.1
|
|
12
|
+
Classifier: Framework :: Django :: 5.2
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Requires-Dist: Django<5.3,>=5.1
|
|
18
|
+
|
|
19
|
+
# django-eadmin
|
|
20
|
+
|
|
21
|
+
`django-eadmin` is a reusable, server-rendered Django administration interface
|
|
22
|
+
using Tailwind CSS, DaisyUI, HTMX, and Alpine.js. It retains Django's built-in
|
|
23
|
+
authentication, model permissions, forms, and audit-log semantics.
|
|
24
|
+
|
|
25
|
+
## Requirements
|
|
26
|
+
|
|
27
|
+
- Python 3.10+
|
|
28
|
+
- Django 5.1 or 5.2
|
|
29
|
+
- Django's `admin`, `auth`, `contenttypes`, `sessions`, `messages`, and
|
|
30
|
+
`staticfiles` applications
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
python -m pip install django-eadmin
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Add EAdmin before applications that register models:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
INSTALLED_APPS = [
|
|
42
|
+
"eadmin",
|
|
43
|
+
"django.contrib.admin",
|
|
44
|
+
"django.contrib.auth",
|
|
45
|
+
"django.contrib.contenttypes",
|
|
46
|
+
"django.contrib.sessions",
|
|
47
|
+
"django.contrib.messages",
|
|
48
|
+
"django.contrib.staticfiles",
|
|
49
|
+
"articles", # Contains articles/eadmin.py.
|
|
50
|
+
]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Run the standard Django setup commands:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python manage.py migrate
|
|
57
|
+
python manage.py createsuperuser
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Routes
|
|
61
|
+
|
|
62
|
+
EAdmin follows Django Admin's familiar public API:
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from django.urls import path
|
|
66
|
+
from eadmin import admin
|
|
67
|
+
|
|
68
|
+
urlpatterns = [
|
|
69
|
+
path("admin/", admin.site.urls),
|
|
70
|
+
]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If native Django Admin must remain available, mount the two sites on different
|
|
74
|
+
prefixes:
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from django.contrib import admin as django_admin
|
|
78
|
+
from django.urls import path
|
|
79
|
+
from eadmin import admin as eadmin_admin
|
|
80
|
+
|
|
81
|
+
urlpatterns = [
|
|
82
|
+
path("admin/", eadmin_admin.site.urls),
|
|
83
|
+
path("django-admin/", django_admin.site.urls),
|
|
84
|
+
]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Register models
|
|
88
|
+
|
|
89
|
+
Create an `eadmin.py` beside `models.py` in an installed application:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
from eadmin import admin
|
|
93
|
+
from eadmin.registry import ModelAdmin
|
|
94
|
+
from .models import Article
|
|
95
|
+
|
|
96
|
+
admin.site.register(Article, ModelAdmin(
|
|
97
|
+
list_display=("title", "state", "updated_at"),
|
|
98
|
+
list_filter=("state",),
|
|
99
|
+
search_fields=("title",),
|
|
100
|
+
fields=("title", "state", "body", "tags"),
|
|
101
|
+
))
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
EAdmin autodiscovers each installed application's `eadmin.py` at Django
|
|
105
|
+
startup. It supports list columns, filtering, search, ordering, readonly
|
|
106
|
+
fields, fieldsets, relationship widgets, actions, inlines, and custom model
|
|
107
|
+
views.
|
|
108
|
+
|
|
109
|
+
## Permissions
|
|
110
|
+
|
|
111
|
+
EAdmin never grants access through its configuration. Users must be active,
|
|
112
|
+
staff, and have Django's standard `view`, `add`, `change`, or `delete` model
|
|
113
|
+
permissions. Superusers retain normal Django access. These checks apply to
|
|
114
|
+
menus, lists, forms, object actions, bulk actions, and inline formsets.
|
|
115
|
+
|
|
116
|
+
## Bundled browser dependencies
|
|
117
|
+
|
|
118
|
+
All browser assets are included in the installed package; EAdmin makes no
|
|
119
|
+
runtime CDN requests.
|
|
120
|
+
|
|
121
|
+
| Dependency | Version |
|
|
122
|
+
| --- | --- |
|
|
123
|
+
| Tailwind CSS Play CDN | 3.4.17 |
|
|
124
|
+
| DaisyUI | 4.12.24 |
|
|
125
|
+
| HTMX | 2.0.4 |
|
|
126
|
+
| Alpine.js | 3.17.4 |
|
|
127
|
+
|
|
128
|
+
See the [source repository](https://github.com/lqcodes/django-eadmin) for
|
|
129
|
+
source code and issue tracking.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# django-eadmin
|
|
2
|
+
|
|
3
|
+
`django-eadmin` is a reusable, server-rendered Django administration interface
|
|
4
|
+
using Tailwind CSS, DaisyUI, HTMX, and Alpine.js. It retains Django's built-in
|
|
5
|
+
authentication, model permissions, forms, and audit-log semantics.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Python 3.10+
|
|
10
|
+
- Django 5.1 or 5.2
|
|
11
|
+
- Django's `admin`, `auth`, `contenttypes`, `sessions`, `messages`, and
|
|
12
|
+
`staticfiles` applications
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
python -m pip install django-eadmin
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Add EAdmin before applications that register models:
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
INSTALLED_APPS = [
|
|
24
|
+
"eadmin",
|
|
25
|
+
"django.contrib.admin",
|
|
26
|
+
"django.contrib.auth",
|
|
27
|
+
"django.contrib.contenttypes",
|
|
28
|
+
"django.contrib.sessions",
|
|
29
|
+
"django.contrib.messages",
|
|
30
|
+
"django.contrib.staticfiles",
|
|
31
|
+
"articles", # Contains articles/eadmin.py.
|
|
32
|
+
]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Run the standard Django setup commands:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
python manage.py migrate
|
|
39
|
+
python manage.py createsuperuser
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Routes
|
|
43
|
+
|
|
44
|
+
EAdmin follows Django Admin's familiar public API:
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from django.urls import path
|
|
48
|
+
from eadmin import admin
|
|
49
|
+
|
|
50
|
+
urlpatterns = [
|
|
51
|
+
path("admin/", admin.site.urls),
|
|
52
|
+
]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If native Django Admin must remain available, mount the two sites on different
|
|
56
|
+
prefixes:
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from django.contrib import admin as django_admin
|
|
60
|
+
from django.urls import path
|
|
61
|
+
from eadmin import admin as eadmin_admin
|
|
62
|
+
|
|
63
|
+
urlpatterns = [
|
|
64
|
+
path("admin/", eadmin_admin.site.urls),
|
|
65
|
+
path("django-admin/", django_admin.site.urls),
|
|
66
|
+
]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Register models
|
|
70
|
+
|
|
71
|
+
Create an `eadmin.py` beside `models.py` in an installed application:
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from eadmin import admin
|
|
75
|
+
from eadmin.registry import ModelAdmin
|
|
76
|
+
from .models import Article
|
|
77
|
+
|
|
78
|
+
admin.site.register(Article, ModelAdmin(
|
|
79
|
+
list_display=("title", "state", "updated_at"),
|
|
80
|
+
list_filter=("state",),
|
|
81
|
+
search_fields=("title",),
|
|
82
|
+
fields=("title", "state", "body", "tags"),
|
|
83
|
+
))
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
EAdmin autodiscovers each installed application's `eadmin.py` at Django
|
|
87
|
+
startup. It supports list columns, filtering, search, ordering, readonly
|
|
88
|
+
fields, fieldsets, relationship widgets, actions, inlines, and custom model
|
|
89
|
+
views.
|
|
90
|
+
|
|
91
|
+
## Permissions
|
|
92
|
+
|
|
93
|
+
EAdmin never grants access through its configuration. Users must be active,
|
|
94
|
+
staff, and have Django's standard `view`, `add`, `change`, or `delete` model
|
|
95
|
+
permissions. Superusers retain normal Django access. These checks apply to
|
|
96
|
+
menus, lists, forms, object actions, bulk actions, and inline formsets.
|
|
97
|
+
|
|
98
|
+
## Bundled browser dependencies
|
|
99
|
+
|
|
100
|
+
All browser assets are included in the installed package; EAdmin makes no
|
|
101
|
+
runtime CDN requests.
|
|
102
|
+
|
|
103
|
+
| Dependency | Version |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| Tailwind CSS Play CDN | 3.4.17 |
|
|
106
|
+
| DaisyUI | 4.12.24 |
|
|
107
|
+
| HTMX | 2.0.4 |
|
|
108
|
+
| Alpine.js | 3.17.4 |
|
|
109
|
+
|
|
110
|
+
See the [source repository](https://github.com/lqcodes/django-eadmin) for
|
|
111
|
+
source code and issue tracking.
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# django-eadmin
|
|
2
|
+
|
|
3
|
+
`django-eadmin` is a reusable, server-rendered Django administration app built
|
|
4
|
+
with Tailwind CSS, DaisyUI, HTMX, and Alpine.js. It uses Django's built-in
|
|
5
|
+
authentication, model permissions, forms, and audit log semantics while
|
|
6
|
+
providing a modern management UI.
|
|
7
|
+
|
|
8
|
+
## Requirements
|
|
9
|
+
|
|
10
|
+
- Python 3.10+
|
|
11
|
+
- Django 5.1 or 5.2
|
|
12
|
+
- A Django project with `django.contrib.auth`, `django.contrib.contenttypes`,
|
|
13
|
+
and `django.contrib.admin` installed
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python -m pip install django-eadmin
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Add EAdmin **before the apps that register models**. No custom template loader
|
|
22
|
+
or `context_processors` configuration is required:
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
INSTALLED_APPS = [
|
|
26
|
+
"eadmin",
|
|
27
|
+
"django.contrib.admin", # Keeps Django's native LogEntry audit trail.
|
|
28
|
+
"django.contrib.auth",
|
|
29
|
+
"django.contrib.contenttypes",
|
|
30
|
+
# …other Django apps
|
|
31
|
+
"articles", # This app contains articles/eadmin.py.
|
|
32
|
+
]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`eadmin` automatically loads its `EAdminConfig`; the longer
|
|
36
|
+
`"eadmin.apps.EAdminConfig"` form is not required.
|
|
37
|
+
|
|
38
|
+
Run migrations and create a staff user as usual:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
python manage.py migrate
|
|
42
|
+
python manage.py createsuperuser
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Bundled frontend dependencies
|
|
46
|
+
|
|
47
|
+
EAdmin bundles its browser dependencies inside the package. No Tailwind,
|
|
48
|
+
DaisyUI, HTMX, or Alpine.js CDN request is made at runtime, so it works in
|
|
49
|
+
offline and restricted-network deployments.
|
|
50
|
+
|
|
51
|
+
| Dependency | Pinned version | Bundled file |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| Tailwind CSS Play CDN | 3.4.17 | `eadmin/vendor/tailwindcss-play-3.4.17.js` |
|
|
54
|
+
| DaisyUI | 4.12.24 | `eadmin/vendor/daisyui-4.12.24.min.css` |
|
|
55
|
+
| HTMX | 2.0.4 | `eadmin/vendor/htmx-2.0.4.min.js` |
|
|
56
|
+
| Alpine.js | 3.17.4 | `eadmin/vendor/alpinejs-3.17.4.min.js` |
|
|
57
|
+
|
|
58
|
+
The assets and their MIT license notices are included in every wheel and
|
|
59
|
+
source distribution. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
|
60
|
+
|
|
61
|
+
For package design decisions, release conventions, and the development record,
|
|
62
|
+
see [docs/DEVELOPMENT_LOG.md](docs/DEVELOPMENT_LOG.md).
|
|
63
|
+
|
|
64
|
+
The repository-scoped Codex skill for maintaining this package is available at
|
|
65
|
+
[`.agents/skills/django-eadmin`](.agents/skills/django-eadmin/SKILL.md). It is
|
|
66
|
+
automatically discovered after cloning the repository and is not distributed as
|
|
67
|
+
Python runtime code.
|
|
68
|
+
|
|
69
|
+
## Routes
|
|
70
|
+
|
|
71
|
+
EAdmin intentionally follows Django Admin's familiar import and URL shape.
|
|
72
|
+
To use EAdmin as the primary administration UI:
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from django.urls import path
|
|
76
|
+
from eadmin import admin
|
|
77
|
+
|
|
78
|
+
urlpatterns = [
|
|
79
|
+
path("admin/", admin.site.urls),
|
|
80
|
+
]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
To keep both UIs during migration or debugging, use explicit aliases and
|
|
84
|
+
different URL prefixes:
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from django.contrib import admin as django_admin
|
|
88
|
+
from django.urls import path
|
|
89
|
+
from eadmin import admin as eadmin_admin
|
|
90
|
+
|
|
91
|
+
urlpatterns = [
|
|
92
|
+
path("admin/", eadmin_admin.site.urls),
|
|
93
|
+
path("django-admin/", django_admin.site.urls),
|
|
94
|
+
]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Do not mount EAdmin and Django's built-in admin at the same prefix.
|
|
98
|
+
|
|
99
|
+
## Register models
|
|
100
|
+
|
|
101
|
+
Create an `eadmin.py` beside `models.py` in any installed Django app. EAdmin
|
|
102
|
+
discovers it when Django starts, just as Django Admin discovers `admin.py`.
|
|
103
|
+
|
|
104
|
+
### Basic registration
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
from eadmin import admin
|
|
108
|
+
from eadmin.registry import ModelAdmin
|
|
109
|
+
from .models import Article
|
|
110
|
+
|
|
111
|
+
admin.site.register(Article, ModelAdmin(
|
|
112
|
+
list_display=("title", "state", "updated_at"),
|
|
113
|
+
list_filter=("state",),
|
|
114
|
+
search_fields=("title",),
|
|
115
|
+
fields=("title", "state", "body", "tags"),
|
|
116
|
+
))
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Complete configuration example
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
from eadmin import admin
|
|
123
|
+
from eadmin.registry import ModelAdmin, action, display
|
|
124
|
+
from .models import Article
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
@display(description="Status", ordering="state", renderer="tag", tag_tone="primary")
|
|
128
|
+
def state_badge(article):
|
|
129
|
+
return article.get_state_display()
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
@action(description="Mark selected articles as published", permissions=("change",))
|
|
133
|
+
def mark_published(model_admin, request, queryset):
|
|
134
|
+
queryset.update(state=Article.State.PUBLISHED)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
admin.site.register(Article, ModelAdmin(
|
|
138
|
+
list_display=("title", "state_badge", "updated_at"),
|
|
139
|
+
display_methods={"state_badge": state_badge},
|
|
140
|
+
list_filter=("state", "author"),
|
|
141
|
+
search_fields=("title", "summary"),
|
|
142
|
+
ordering=("-updated_at",),
|
|
143
|
+
fields=("title", "slug", "summary", "body", "state", "author", "tags"),
|
|
144
|
+
readonly_fields=("slug",),
|
|
145
|
+
prepopulated_fields={"slug": ("title",)},
|
|
146
|
+
filter_horizontal=("tags",),
|
|
147
|
+
actions=(mark_published,),
|
|
148
|
+
menu_group="content",
|
|
149
|
+
menu_group_label="Content",
|
|
150
|
+
menu_group_icon="document-text",
|
|
151
|
+
))
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Use `InlineModelAdmin` in the `inlines` setting for related formsets. EAdmin
|
|
155
|
+
supports list columns, filtering, search, ordering, readonly fields, grouped
|
|
156
|
+
fieldsets, relationship widgets, bulk actions, inlines, and per-model custom
|
|
157
|
+
views.
|
|
158
|
+
|
|
159
|
+
## Permissions
|
|
160
|
+
|
|
161
|
+
EAdmin never grants permissions on its own. A user must be active, staff, and
|
|
162
|
+
hold Django's standard model permission: `view`, `add`, `change`, or `delete`.
|
|
163
|
+
Superusers retain their normal unrestricted access. The same permission checks
|
|
164
|
+
are applied to menus, lists, forms, object actions, bulk actions, and inline
|
|
165
|
+
formsets; custom configuration hooks can only further restrict access.
|
|
166
|
+
|
|
167
|
+
Assign users, groups, and permissions through Django Admin or an EAdmin
|
|
168
|
+
registration of Django's auth models.
|
|
169
|
+
|
|
170
|
+
## Configuration notes
|
|
171
|
+
|
|
172
|
+
- Foreign key and one-to-one fields use a single-select widget by default.
|
|
173
|
+
- Many-to-many fields use a multi-select widget by default.
|
|
174
|
+
- `filter_horizontal` enables a transfer widget for selected many-to-many
|
|
175
|
+
fields; `raw_id_fields` and `autocomplete_fields` remain available for large
|
|
176
|
+
datasets.
|
|
177
|
+
- EAdmin does not replace Django Admin. Keeping native Admin on a separate URL
|
|
178
|
+
is useful for migrations and emergency operations.
|
|
179
|
+
|
|
180
|
+
## Development install
|
|
181
|
+
|
|
182
|
+
From a checkout containing this package:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
python -m pip install -e .
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Releases
|
|
189
|
+
|
|
190
|
+
There are two release paths:
|
|
191
|
+
|
|
192
|
+
- **Manual workflow run**: enter a target version and release notes. Leaving
|
|
193
|
+
the version blank automatically increments the patch version (for example,
|
|
194
|
+
`0.0.1` to `0.0.2`). Leaving notes blank generates them from commits since
|
|
195
|
+
the previous tag. The workflow updates `pyproject.toml`, writes
|
|
196
|
+
`CHANGELOG.md`, commits, tags, and creates a GitHub Release.
|
|
197
|
+
- **Push a tag**: appropriate when version and changelog are maintained
|
|
198
|
+
locally. The `pyproject.toml` version must match the tag.
|
|
199
|
+
|
|
200
|
+
To test the release pipeline without changing anything, run the workflow
|
|
201
|
+
manually with **dry_run** enabled. It builds the package and runs `twine
|
|
202
|
+
check`, but does not change the version, commit files, create a tag, upload to
|
|
203
|
+
PyPI, or create a GitHub Release.
|
|
204
|
+
|
|
205
|
+
For example, version `0.0.1` must be released with tag `v0.0.1`:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
git tag v0.0.1
|
|
209
|
+
git push origin v0.0.1
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
The workflow safely skips package files that already exist on PyPI, so
|
|
213
|
+
re-running a completed release does not fail. Add the PyPI project token to
|
|
214
|
+
the repository's Actions secrets as
|
|
215
|
+
`PYPI_API_TOKEN`; it is never stored in this repository.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
The following browser assets are distributed in `eadmin/static/eadmin/vendor/`
|
|
4
|
+
so EAdmin works without runtime CDN requests. Each asset retains its upstream
|
|
5
|
+
MIT license in the adjacent `LICENSE.*` file.
|
|
6
|
+
|
|
7
|
+
| Dependency | Version | Asset |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| Tailwind CSS Play CDN | 3.4.17 | `tailwindcss-play-3.4.17.js` |
|
|
10
|
+
| DaisyUI | 4.12.24 | `daisyui-4.12.24.min.css` |
|
|
11
|
+
| HTMX | 2.0.4 | `htmx-2.0.4.min.js` |
|
|
12
|
+
| Alpine.js | 3.17.4 | `alpinejs-3.17.4.min.js` |
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: django-eadmin
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: A reusable Tailwind, HTMX, Alpine.js, and DaisyUI Django administration app.
|
|
5
|
+
Author: EAdmin contributors
|
|
6
|
+
License-Expression: LicenseRef-Proprietary
|
|
7
|
+
Project-URL: Homepage, https://github.com/lqcodes/django-eadmin
|
|
8
|
+
Project-URL: Source, https://github.com/lqcodes/django-eadmin
|
|
9
|
+
Project-URL: Issues, https://github.com/lqcodes/django-eadmin/issues
|
|
10
|
+
Classifier: Framework :: Django
|
|
11
|
+
Classifier: Framework :: Django :: 5.1
|
|
12
|
+
Classifier: Framework :: Django :: 5.2
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Requires-Dist: Django<5.3,>=5.1
|
|
18
|
+
|
|
19
|
+
# django-eadmin
|
|
20
|
+
|
|
21
|
+
`django-eadmin` is a reusable, server-rendered Django administration interface
|
|
22
|
+
using Tailwind CSS, DaisyUI, HTMX, and Alpine.js. It retains Django's built-in
|
|
23
|
+
authentication, model permissions, forms, and audit-log semantics.
|
|
24
|
+
|
|
25
|
+
## Requirements
|
|
26
|
+
|
|
27
|
+
- Python 3.10+
|
|
28
|
+
- Django 5.1 or 5.2
|
|
29
|
+
- Django's `admin`, `auth`, `contenttypes`, `sessions`, `messages`, and
|
|
30
|
+
`staticfiles` applications
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
python -m pip install django-eadmin
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Add EAdmin before applications that register models:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
INSTALLED_APPS = [
|
|
42
|
+
"eadmin",
|
|
43
|
+
"django.contrib.admin",
|
|
44
|
+
"django.contrib.auth",
|
|
45
|
+
"django.contrib.contenttypes",
|
|
46
|
+
"django.contrib.sessions",
|
|
47
|
+
"django.contrib.messages",
|
|
48
|
+
"django.contrib.staticfiles",
|
|
49
|
+
"articles", # Contains articles/eadmin.py.
|
|
50
|
+
]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Run the standard Django setup commands:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python manage.py migrate
|
|
57
|
+
python manage.py createsuperuser
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Routes
|
|
61
|
+
|
|
62
|
+
EAdmin follows Django Admin's familiar public API:
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from django.urls import path
|
|
66
|
+
from eadmin import admin
|
|
67
|
+
|
|
68
|
+
urlpatterns = [
|
|
69
|
+
path("admin/", admin.site.urls),
|
|
70
|
+
]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If native Django Admin must remain available, mount the two sites on different
|
|
74
|
+
prefixes:
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from django.contrib import admin as django_admin
|
|
78
|
+
from django.urls import path
|
|
79
|
+
from eadmin import admin as eadmin_admin
|
|
80
|
+
|
|
81
|
+
urlpatterns = [
|
|
82
|
+
path("admin/", eadmin_admin.site.urls),
|
|
83
|
+
path("django-admin/", django_admin.site.urls),
|
|
84
|
+
]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Register models
|
|
88
|
+
|
|
89
|
+
Create an `eadmin.py` beside `models.py` in an installed application:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
from eadmin import admin
|
|
93
|
+
from eadmin.registry import ModelAdmin
|
|
94
|
+
from .models import Article
|
|
95
|
+
|
|
96
|
+
admin.site.register(Article, ModelAdmin(
|
|
97
|
+
list_display=("title", "state", "updated_at"),
|
|
98
|
+
list_filter=("state",),
|
|
99
|
+
search_fields=("title",),
|
|
100
|
+
fields=("title", "state", "body", "tags"),
|
|
101
|
+
))
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
EAdmin autodiscovers each installed application's `eadmin.py` at Django
|
|
105
|
+
startup. It supports list columns, filtering, search, ordering, readonly
|
|
106
|
+
fields, fieldsets, relationship widgets, actions, inlines, and custom model
|
|
107
|
+
views.
|
|
108
|
+
|
|
109
|
+
## Permissions
|
|
110
|
+
|
|
111
|
+
EAdmin never grants access through its configuration. Users must be active,
|
|
112
|
+
staff, and have Django's standard `view`, `add`, `change`, or `delete` model
|
|
113
|
+
permissions. Superusers retain normal Django access. These checks apply to
|
|
114
|
+
menus, lists, forms, object actions, bulk actions, and inline formsets.
|
|
115
|
+
|
|
116
|
+
## Bundled browser dependencies
|
|
117
|
+
|
|
118
|
+
All browser assets are included in the installed package; EAdmin makes no
|
|
119
|
+
runtime CDN requests.
|
|
120
|
+
|
|
121
|
+
| Dependency | Version |
|
|
122
|
+
| --- | --- |
|
|
123
|
+
| Tailwind CSS Play CDN | 3.4.17 |
|
|
124
|
+
| DaisyUI | 4.12.24 |
|
|
125
|
+
| HTMX | 2.0.4 |
|
|
126
|
+
| Alpine.js | 3.17.4 |
|
|
127
|
+
|
|
128
|
+
See the [source repository](https://github.com/lqcodes/django-eadmin) for
|
|
129
|
+
source code and issue tracking.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
MANIFEST.in
|
|
2
|
+
PYPI_README.md
|
|
3
|
+
README.md
|
|
4
|
+
THIRD_PARTY_NOTICES.md
|
|
5
|
+
pyproject.toml
|
|
6
|
+
django_eadmin.egg-info/PKG-INFO
|
|
7
|
+
django_eadmin.egg-info/SOURCES.txt
|
|
8
|
+
django_eadmin.egg-info/dependency_links.txt
|
|
9
|
+
django_eadmin.egg-info/requires.txt
|
|
10
|
+
django_eadmin.egg-info/top_level.txt
|
|
11
|
+
eadmin/__init__.py
|
|
12
|
+
eadmin/__init__.pyi
|
|
13
|
+
eadmin/admin.py
|
|
14
|
+
eadmin/apps.py
|
|
15
|
+
eadmin/context_processors.py
|
|
16
|
+
eadmin/forms.py
|
|
17
|
+
eadmin/permissions.py
|
|
18
|
+
eadmin/py.typed
|
|
19
|
+
eadmin/registry.py
|
|
20
|
+
eadmin/urls.py
|
|
21
|
+
eadmin/views.py
|
|
22
|
+
eadmin/static/eadmin/eadmin.css
|
|
23
|
+
eadmin/static/eadmin/eadmin.js
|
|
24
|
+
eadmin/static/eadmin/logo.svg
|
|
25
|
+
eadmin/static/eadmin/vendor/LICENSE.alpinejs
|
|
26
|
+
eadmin/static/eadmin/vendor/LICENSE.daisyui
|
|
27
|
+
eadmin/static/eadmin/vendor/LICENSE.htmx
|
|
28
|
+
eadmin/static/eadmin/vendor/LICENSE.tailwindcss
|
|
29
|
+
eadmin/static/eadmin/vendor/alpinejs-3.17.4.min.js
|
|
30
|
+
eadmin/static/eadmin/vendor/daisyui-4.12.24.min.css
|
|
31
|
+
eadmin/static/eadmin/vendor/htmx-2.0.4.min.js
|
|
32
|
+
eadmin/static/eadmin/vendor/tailwindcss-play-3.4.17.js
|
|
33
|
+
eadmin/templates/eadmin/base.html
|
|
34
|
+
eadmin/templates/eadmin/dashboard.html
|
|
35
|
+
eadmin/templates/eadmin/login.html
|
|
36
|
+
eadmin/templates/eadmin/model_detail.html
|
|
37
|
+
eadmin/templates/eadmin/model_form.html
|
|
38
|
+
eadmin/templates/eadmin/model_history.html
|
|
39
|
+
eadmin/templates/eadmin/model_list.html
|
|
40
|
+
eadmin/templates/eadmin/password_form.html
|
|
41
|
+
eadmin/templates/eadmin/partials/object_table.html
|
|
42
|
+
eadmin/templates/eadmin/widgets/autocomplete.html
|
|
43
|
+
eadmin/templates/eadmin/widgets/datetime.html
|
|
44
|
+
eadmin/templates/eadmin/widgets/multiselect.html
|
|
45
|
+
eadmin/templates/eadmin/widgets/raw_id.html
|
|
46
|
+
eadmin/templates/eadmin/widgets/select.html
|
|
47
|
+
eadmin/templates/eadmin/widgets/transfer_select.html
|
|
48
|
+
eadmin/templatetags/__init__.py
|
|
49
|
+
eadmin/templatetags/eadmin.py
|
|
50
|
+
eadmin/tests/__init__.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Django<5.3,>=5.1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
eadmin
|