django-admin-forge 0.1.0__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.
Files changed (39) hide show
  1. django_admin_forge-0.1.0/LICENSE +21 -0
  2. django_admin_forge-0.1.0/PKG-INFO +261 -0
  3. django_admin_forge-0.1.0/README.md +224 -0
  4. django_admin_forge-0.1.0/pyproject.toml +69 -0
  5. django_admin_forge-0.1.0/setup.cfg +4 -0
  6. django_admin_forge-0.1.0/src/django_admin_forge/__init__.py +5 -0
  7. django_admin_forge-0.1.0/src/django_admin_forge/admin.py +1 -0
  8. django_admin_forge-0.1.0/src/django_admin_forge/apps.py +7 -0
  9. django_admin_forge-0.1.0/src/django_admin_forge/conf.py +65 -0
  10. django_admin_forge-0.1.0/src/django_admin_forge/hooks.py +51 -0
  11. django_admin_forge-0.1.0/src/django_admin_forge/icons.py +44 -0
  12. django_admin_forge-0.1.0/src/django_admin_forge/site.py +211 -0
  13. django_admin_forge-0.1.0/src/django_admin_forge/static/django_admin_forge/css/forge.css +746 -0
  14. django_admin_forge-0.1.0/src/django_admin_forge/static/django_admin_forge/js/theme.js +293 -0
  15. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/actions.html +38 -0
  16. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/base_site.html +71 -0
  17. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/change_form.html +59 -0
  18. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/change_list.html +139 -0
  19. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/change_list_results.html +47 -0
  20. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/forge/cards/system_health.html +18 -0
  21. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/forge_applications.html +36 -0
  22. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/forge_dashboard.html +138 -0
  23. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/includes/fieldset.html +50 -0
  24. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/includes/forge_sidebar.html +105 -0
  25. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/includes/forge_topbar.html +26 -0
  26. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/login.html +37 -0
  27. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/password_change_done.html +23 -0
  28. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/password_change_form.html +86 -0
  29. django_admin_forge-0.1.0/src/django_admin_forge/templates/admin/submit_line.html +43 -0
  30. django_admin_forge-0.1.0/src/django_admin_forge/templatetags/__init__.py +1 -0
  31. django_admin_forge-0.1.0/src/django_admin_forge/templatetags/forge_icons.py +57 -0
  32. django_admin_forge-0.1.0/src/django_admin_forge/urls.py +5 -0
  33. django_admin_forge-0.1.0/src/django_admin_forge/views.py +33 -0
  34. django_admin_forge-0.1.0/src/django_admin_forge.egg-info/PKG-INFO +261 -0
  35. django_admin_forge-0.1.0/src/django_admin_forge.egg-info/SOURCES.txt +37 -0
  36. django_admin_forge-0.1.0/src/django_admin_forge.egg-info/dependency_links.txt +1 -0
  37. django_admin_forge-0.1.0/src/django_admin_forge.egg-info/requires.txt +11 -0
  38. django_admin_forge-0.1.0/src/django_admin_forge.egg-info/top_level.txt +1 -0
  39. django_admin_forge-0.1.0/tests/test_site.py +67 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 django-admin-forge contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,261 @@
1
+ Metadata-Version: 2.4
2
+ Name: django-admin-forge
3
+ Version: 0.1.0
4
+ Summary: A modern, extensible, premium Django admin framework.
5
+ Author: django-admin-forge contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/your-org/django-admin-forge
8
+ Project-URL: Documentation, https://github.com/your-org/django-admin-forge/docs
9
+ Project-URL: Repository, https://github.com/your-org/django-admin-forge
10
+ Project-URL: Issues, https://github.com/your-org/django-admin-forge/issues
11
+ Keywords: django,admin,dashboard,saas,internal-tools
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Framework :: Django
14
+ Classifier: Framework :: Django :: 4.2
15
+ Classifier: Framework :: Django :: 5.0
16
+ Classifier: Framework :: Django :: 5.1
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Requires-Python: >=3.11
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: Django<6.0,>=4.2
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=8.0; extra == "dev"
30
+ Requires-Dist: pytest-django>=4.8; extra == "dev"
31
+ Requires-Dist: ruff>=0.6; extra == "dev"
32
+ Requires-Dist: build>=1.2; extra == "dev"
33
+ Provides-Extra: publish
34
+ Requires-Dist: build>=1.2; extra == "publish"
35
+ Requires-Dist: twine>=6.0; extra == "publish"
36
+ Dynamic: license-file
37
+
38
+ # django-admin-forge
39
+
40
+ `django-admin-forge` is a modern, customizable Django admin framework for serious SaaS and enterprise apps.
41
+
42
+ It keeps Django admin's reliability and model integration, while upgrading the UI/UX, theming, and developer customization surface.
43
+
44
+ ## Highlights
45
+
46
+ - Django-first admin replacement (`AdminSite`-based)
47
+ - Branded login and modern dashboard
48
+ - Customizable sidebar menus and app/model navigation
49
+ - Dark, light, and system themes
50
+ - Accent color system
51
+ - Improved changelist, filters, bulk actions, and empty states
52
+ - Improved add/edit form layout
53
+
54
+ ## Install
55
+
56
+ From [PyPI](https://pypi.org/project/django-admin-forge/):
57
+
58
+ ```bash
59
+ pip install django-admin-forge
60
+ ```
61
+
62
+ If you previously tried the `django-forge` distribution name, switch to this package: update `INSTALLED_APPS` and imports to `django_admin_forge`, rename settings `DJANGO_ADMIN_FORGE`, then `pip uninstall django-forge` (if installed) and install as above.
63
+
64
+ From a wheel or sdist you built locally:
65
+
66
+ ```bash
67
+ python -m pip install build
68
+ python -m build
69
+ pip install dist/django_admin_forge-*.whl
70
+ ```
71
+
72
+ Develop this repository (editable install, tests, lint):
73
+
74
+ ```bash
75
+ python -m venv .venv
76
+ source .venv/bin/activate
77
+ pip install -e ".[dev]"
78
+ ```
79
+
80
+ ### Publishing to PyPI
81
+
82
+ 1. Configure [PyPI](https://pypi.org/account/) credentials (for example [upload with `twine`](https://twine.readthedocs.io/) or `uv publish`).
83
+ 2. Bump `version` in `pyproject.toml`.
84
+ 3. Install build tools: `pip install ".[publish]"` (or `pip install build twine`).
85
+ 4. Run `python -m build`, then `twine check dist/*` and `twine upload dist/*`.
86
+
87
+ Use [TestPyPI](https://test.pypi.org/) first if you want a dry run: `twine upload --repository testpypi dist/*`.
88
+
89
+ ## Quick Integration
90
+
91
+ ### 1) Add apps
92
+
93
+ ```python
94
+ INSTALLED_APPS = [
95
+ "django_admin_forge",
96
+ "django.contrib.admin",
97
+ "django.contrib.auth",
98
+ "django.contrib.contenttypes",
99
+ "django.contrib.sessions",
100
+ "django.contrib.messages",
101
+ "django.contrib.staticfiles",
102
+ # your apps...
103
+ ]
104
+ ```
105
+
106
+ ### 2) Use Forge admin URLs
107
+
108
+ ```python
109
+ from django.urls import path
110
+ from django_admin_forge.site import forge_admin_site
111
+
112
+ urlpatterns = [
113
+ path("admin/", forge_admin_site.urls),
114
+ ]
115
+ ```
116
+
117
+ ### 3) Configure `DJANGO_ADMIN_FORGE` (optional but recommended)
118
+
119
+ ```python
120
+ DJANGO_ADMIN_FORGE = {
121
+ "brand_name": "Forge Admin",
122
+ "brand_logo_text": "FORGE",
123
+ "brand_tagline": "Modern Django operations panel",
124
+ "accent_color": "green",
125
+ "default_theme": "system", # "light" | "dark" | "system"
126
+ "show_sidebar_search": True,
127
+ "enable_command_bar": True,
128
+ }
129
+ ```
130
+
131
+ ## Configuration Reference
132
+
133
+ Use the `DJANGO_ADMIN_FORGE` setting dictionary.
134
+
135
+ - `brand_name` (`str`): Header brand name.
136
+ - `brand_logo_text` (`str`): Compact sidebar/logo text.
137
+ - `brand_tagline` (`str`): Login/subtitle branding.
138
+ - `accent_color` (`str`): Accent token used in key actions and highlights.
139
+ - `default_theme` (`"light" | "dark" | "system"`): Initial theme mode.
140
+ - `show_sidebar_search` (`bool`): Sidebar search input visibility.
141
+ - `enable_command_bar` (`bool`): Header search/command input visibility.
142
+ - `menu_icons` (`dict[str, str]`): Overrides for app/model icons.
143
+ - `menu_tabs` (`list[dict]`): Sidebar menu tabs (top and bottom areas).
144
+ - `dashboard_analytics_cards` (`list[dict]`): Override dashboard KPI cards for marketing/business snapshots.
145
+
146
+ ## Accent Colors
147
+
148
+ Supported `accent_color` values:
149
+
150
+ `blue`, `green`, `amber`, `violet`, `emerald`, `teal`, `cyan`, `sky`, `indigo`, `purple`, `pink`, `rose`, `red`, `orange`, `yellow`, `lime`, `slate`, `gray`, `zinc`, `neutral`, `stone`
151
+
152
+ Example:
153
+
154
+ ```python
155
+ DJANGO_ADMIN_FORGE = {
156
+ "accent_color": "rose",
157
+ }
158
+ ```
159
+
160
+ ## Sidebar Menus (`menu_tabs`)
161
+
162
+ By default, only `Dashboard` is shown.
163
+
164
+ You can fully configure sidebar tabs:
165
+
166
+ ```python
167
+ DJANGO_ADMIN_FORGE = {
168
+ "menu_tabs": [
169
+ {"label": "Dashboard", "url_name": "admin:index", "icon": "layout-grid"},
170
+ {"label": "Applications", "url_name": "admin:forge-applications", "icon": "layers"},
171
+ {"label": "Users", "url_name": "admin:auth_user_changelist", "icon": "user"},
172
+ {"label": "Documentation", "url": "/docs/", "icon": "external-link"},
173
+ ]
174
+ }
175
+ ```
176
+
177
+ Each tab supports:
178
+
179
+ - `label` (required)
180
+ - `url_name` (reverse name) or `url` (direct URL)
181
+ - `icon` (optional, defaults to `layout-grid`)
182
+
183
+ ## Menu Icon Overrides (`menu_icons`)
184
+
185
+ You can override app/model icons by key:
186
+
187
+ ```python
188
+ DJANGO_ADMIN_FORGE = {
189
+ "menu_icons": {
190
+ "auth": "shield", # app-level
191
+ "auth.user": "user", # model-level
192
+ "auth.group": "users",
193
+ "demo_app.customer": "building",
194
+ }
195
+ }
196
+ ```
197
+
198
+ Resolution order:
199
+ 1. `app_label.model_name`
200
+ 2. `model_name`
201
+ 3. `app_label`
202
+ 4. built-in defaults
203
+
204
+ ## Dashboard Analytics Cards
205
+
206
+ You can supply custom KPI cards for the dashboard hero section using real model data:
207
+
208
+ ```python
209
+ DJANGO_ADMIN_FORGE = {
210
+ "dashboard_analytics_cards": [
211
+ {
212
+ "label": "Customers",
213
+ "app_label": "demo_app",
214
+ "model": "Customer",
215
+ "metric": "count",
216
+ "icon": "users",
217
+ "hint": "Total customer records",
218
+ },
219
+ {
220
+ "label": "Active customers",
221
+ "app_label": "demo_app",
222
+ "model": "Customer",
223
+ "metric": "count",
224
+ "queryset_filter": {"is_active": True},
225
+ "icon": "activity",
226
+ "hint": "is_active = true",
227
+ },
228
+ ]
229
+ }
230
+ ```
231
+
232
+ Each card supports:
233
+ - `label` (required)
234
+ - `app_label` and `model` for dynamic model-based metrics
235
+ - `metric` (currently supports `count`)
236
+ - `queryset_filter` (optional exact Django ORM filters)
237
+ - `value` (optional fallback/manual value)
238
+ - `icon`
239
+ - `hint` (or `trend`)
240
+
241
+ ## Demo Project (this repo)
242
+
243
+ ```bash
244
+ python demo/manage.py migrate
245
+ python demo/manage.py createsuperuser
246
+ python demo/manage.py runserver
247
+ ```
248
+
249
+ Open: [http://127.0.0.1:8000/admin/](http://127.0.0.1:8000/admin/)
250
+
251
+ ## Status and Roadmap
252
+
253
+ Current implementation includes custom site templates, dashboard, apps page, collapsible sidebar, filters modal, improved forms/changelists, search helpers, and theme controls.
254
+
255
+ Planned next:
256
+
257
+ - Saved views/filters
258
+ - Dashboard widget API expansion
259
+ - Accessibility and keyboard navigation improvements
260
+ - Packaging/build pipeline polish for production release
261
+
@@ -0,0 +1,224 @@
1
+ # django-admin-forge
2
+
3
+ `django-admin-forge` is a modern, customizable Django admin framework for serious SaaS and enterprise apps.
4
+
5
+ It keeps Django admin's reliability and model integration, while upgrading the UI/UX, theming, and developer customization surface.
6
+
7
+ ## Highlights
8
+
9
+ - Django-first admin replacement (`AdminSite`-based)
10
+ - Branded login and modern dashboard
11
+ - Customizable sidebar menus and app/model navigation
12
+ - Dark, light, and system themes
13
+ - Accent color system
14
+ - Improved changelist, filters, bulk actions, and empty states
15
+ - Improved add/edit form layout
16
+
17
+ ## Install
18
+
19
+ From [PyPI](https://pypi.org/project/django-admin-forge/):
20
+
21
+ ```bash
22
+ pip install django-admin-forge
23
+ ```
24
+
25
+ If you previously tried the `django-forge` distribution name, switch to this package: update `INSTALLED_APPS` and imports to `django_admin_forge`, rename settings `DJANGO_ADMIN_FORGE`, then `pip uninstall django-forge` (if installed) and install as above.
26
+
27
+ From a wheel or sdist you built locally:
28
+
29
+ ```bash
30
+ python -m pip install build
31
+ python -m build
32
+ pip install dist/django_admin_forge-*.whl
33
+ ```
34
+
35
+ Develop this repository (editable install, tests, lint):
36
+
37
+ ```bash
38
+ python -m venv .venv
39
+ source .venv/bin/activate
40
+ pip install -e ".[dev]"
41
+ ```
42
+
43
+ ### Publishing to PyPI
44
+
45
+ 1. Configure [PyPI](https://pypi.org/account/) credentials (for example [upload with `twine`](https://twine.readthedocs.io/) or `uv publish`).
46
+ 2. Bump `version` in `pyproject.toml`.
47
+ 3. Install build tools: `pip install ".[publish]"` (or `pip install build twine`).
48
+ 4. Run `python -m build`, then `twine check dist/*` and `twine upload dist/*`.
49
+
50
+ Use [TestPyPI](https://test.pypi.org/) first if you want a dry run: `twine upload --repository testpypi dist/*`.
51
+
52
+ ## Quick Integration
53
+
54
+ ### 1) Add apps
55
+
56
+ ```python
57
+ INSTALLED_APPS = [
58
+ "django_admin_forge",
59
+ "django.contrib.admin",
60
+ "django.contrib.auth",
61
+ "django.contrib.contenttypes",
62
+ "django.contrib.sessions",
63
+ "django.contrib.messages",
64
+ "django.contrib.staticfiles",
65
+ # your apps...
66
+ ]
67
+ ```
68
+
69
+ ### 2) Use Forge admin URLs
70
+
71
+ ```python
72
+ from django.urls import path
73
+ from django_admin_forge.site import forge_admin_site
74
+
75
+ urlpatterns = [
76
+ path("admin/", forge_admin_site.urls),
77
+ ]
78
+ ```
79
+
80
+ ### 3) Configure `DJANGO_ADMIN_FORGE` (optional but recommended)
81
+
82
+ ```python
83
+ DJANGO_ADMIN_FORGE = {
84
+ "brand_name": "Forge Admin",
85
+ "brand_logo_text": "FORGE",
86
+ "brand_tagline": "Modern Django operations panel",
87
+ "accent_color": "green",
88
+ "default_theme": "system", # "light" | "dark" | "system"
89
+ "show_sidebar_search": True,
90
+ "enable_command_bar": True,
91
+ }
92
+ ```
93
+
94
+ ## Configuration Reference
95
+
96
+ Use the `DJANGO_ADMIN_FORGE` setting dictionary.
97
+
98
+ - `brand_name` (`str`): Header brand name.
99
+ - `brand_logo_text` (`str`): Compact sidebar/logo text.
100
+ - `brand_tagline` (`str`): Login/subtitle branding.
101
+ - `accent_color` (`str`): Accent token used in key actions and highlights.
102
+ - `default_theme` (`"light" | "dark" | "system"`): Initial theme mode.
103
+ - `show_sidebar_search` (`bool`): Sidebar search input visibility.
104
+ - `enable_command_bar` (`bool`): Header search/command input visibility.
105
+ - `menu_icons` (`dict[str, str]`): Overrides for app/model icons.
106
+ - `menu_tabs` (`list[dict]`): Sidebar menu tabs (top and bottom areas).
107
+ - `dashboard_analytics_cards` (`list[dict]`): Override dashboard KPI cards for marketing/business snapshots.
108
+
109
+ ## Accent Colors
110
+
111
+ Supported `accent_color` values:
112
+
113
+ `blue`, `green`, `amber`, `violet`, `emerald`, `teal`, `cyan`, `sky`, `indigo`, `purple`, `pink`, `rose`, `red`, `orange`, `yellow`, `lime`, `slate`, `gray`, `zinc`, `neutral`, `stone`
114
+
115
+ Example:
116
+
117
+ ```python
118
+ DJANGO_ADMIN_FORGE = {
119
+ "accent_color": "rose",
120
+ }
121
+ ```
122
+
123
+ ## Sidebar Menus (`menu_tabs`)
124
+
125
+ By default, only `Dashboard` is shown.
126
+
127
+ You can fully configure sidebar tabs:
128
+
129
+ ```python
130
+ DJANGO_ADMIN_FORGE = {
131
+ "menu_tabs": [
132
+ {"label": "Dashboard", "url_name": "admin:index", "icon": "layout-grid"},
133
+ {"label": "Applications", "url_name": "admin:forge-applications", "icon": "layers"},
134
+ {"label": "Users", "url_name": "admin:auth_user_changelist", "icon": "user"},
135
+ {"label": "Documentation", "url": "/docs/", "icon": "external-link"},
136
+ ]
137
+ }
138
+ ```
139
+
140
+ Each tab supports:
141
+
142
+ - `label` (required)
143
+ - `url_name` (reverse name) or `url` (direct URL)
144
+ - `icon` (optional, defaults to `layout-grid`)
145
+
146
+ ## Menu Icon Overrides (`menu_icons`)
147
+
148
+ You can override app/model icons by key:
149
+
150
+ ```python
151
+ DJANGO_ADMIN_FORGE = {
152
+ "menu_icons": {
153
+ "auth": "shield", # app-level
154
+ "auth.user": "user", # model-level
155
+ "auth.group": "users",
156
+ "demo_app.customer": "building",
157
+ }
158
+ }
159
+ ```
160
+
161
+ Resolution order:
162
+ 1. `app_label.model_name`
163
+ 2. `model_name`
164
+ 3. `app_label`
165
+ 4. built-in defaults
166
+
167
+ ## Dashboard Analytics Cards
168
+
169
+ You can supply custom KPI cards for the dashboard hero section using real model data:
170
+
171
+ ```python
172
+ DJANGO_ADMIN_FORGE = {
173
+ "dashboard_analytics_cards": [
174
+ {
175
+ "label": "Customers",
176
+ "app_label": "demo_app",
177
+ "model": "Customer",
178
+ "metric": "count",
179
+ "icon": "users",
180
+ "hint": "Total customer records",
181
+ },
182
+ {
183
+ "label": "Active customers",
184
+ "app_label": "demo_app",
185
+ "model": "Customer",
186
+ "metric": "count",
187
+ "queryset_filter": {"is_active": True},
188
+ "icon": "activity",
189
+ "hint": "is_active = true",
190
+ },
191
+ ]
192
+ }
193
+ ```
194
+
195
+ Each card supports:
196
+ - `label` (required)
197
+ - `app_label` and `model` for dynamic model-based metrics
198
+ - `metric` (currently supports `count`)
199
+ - `queryset_filter` (optional exact Django ORM filters)
200
+ - `value` (optional fallback/manual value)
201
+ - `icon`
202
+ - `hint` (or `trend`)
203
+
204
+ ## Demo Project (this repo)
205
+
206
+ ```bash
207
+ python demo/manage.py migrate
208
+ python demo/manage.py createsuperuser
209
+ python demo/manage.py runserver
210
+ ```
211
+
212
+ Open: [http://127.0.0.1:8000/admin/](http://127.0.0.1:8000/admin/)
213
+
214
+ ## Status and Roadmap
215
+
216
+ Current implementation includes custom site templates, dashboard, apps page, collapsible sidebar, filters modal, improved forms/changelists, search helpers, and theme controls.
217
+
218
+ Planned next:
219
+
220
+ - Saved views/filters
221
+ - Dashboard widget API expansion
222
+ - Accessibility and keyboard navigation improvements
223
+ - Packaging/build pipeline polish for production release
224
+
@@ -0,0 +1,69 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "django-admin-forge"
7
+ version = "0.1.0"
8
+ description = "A modern, extensible, premium Django admin framework."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ { name = "django-admin-forge contributors" }
15
+ ]
16
+ keywords = ["django", "admin", "dashboard", "saas", "internal-tools"]
17
+ classifiers = [
18
+ "Development Status :: 3 - Alpha",
19
+ "Framework :: Django",
20
+ "Framework :: Django :: 4.2",
21
+ "Framework :: Django :: 5.0",
22
+ "Framework :: Django :: 5.1",
23
+ "Intended Audience :: Developers",
24
+ "Programming Language :: Python :: 3",
25
+ "Programming Language :: Python :: 3 :: Only",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
29
+ "Topic :: Software Development :: Libraries :: Python Modules"
30
+ ]
31
+ dependencies = [
32
+ "Django>=4.2,<6.0"
33
+ ]
34
+
35
+ [project.optional-dependencies]
36
+ dev = [
37
+ "pytest>=8.0",
38
+ "pytest-django>=4.8",
39
+ "ruff>=0.6",
40
+ "build>=1.2",
41
+ ]
42
+ publish = [
43
+ "build>=1.2",
44
+ "twine>=6.0",
45
+ ]
46
+
47
+ [project.urls]
48
+ Homepage = "https://github.com/your-org/django-admin-forge"
49
+ Documentation = "https://github.com/your-org/django-admin-forge/docs"
50
+ Repository = "https://github.com/your-org/django-admin-forge"
51
+ Issues = "https://github.com/your-org/django-admin-forge/issues"
52
+
53
+ [tool.setuptools]
54
+ package-dir = {"" = "src"}
55
+ include-package-data = true
56
+
57
+ [tool.setuptools.packages.find]
58
+ where = ["src"]
59
+
60
+ [tool.setuptools.package-data]
61
+ django_admin_forge = [
62
+ "templates/**/*.html",
63
+ "static/**/*",
64
+ ]
65
+
66
+ [tool.pytest.ini_options]
67
+ DJANGO_SETTINGS_MODULE = "tests.settings"
68
+ pythonpath = ["src"]
69
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ """django-admin-forge package."""
2
+
3
+ from .conf import ForgeSettings, get_forge_settings
4
+
5
+ __all__ = ["ForgeSettings", "get_forge_settings"]
@@ -0,0 +1 @@
1
+ """Admin registrations for django-admin-forge itself."""
@@ -0,0 +1,7 @@
1
+ from django.apps import AppConfig
2
+
3
+
4
+ class DjangoAdminForgeConfig(AppConfig):
5
+ default_auto_field = "django.db.models.BigAutoField"
6
+ name = "django_admin_forge"
7
+ verbose_name = "Django Admin Forge"
@@ -0,0 +1,65 @@
1
+ from dataclasses import asdict, dataclass, field
2
+
3
+ from django.conf import settings
4
+
5
+ ACCENT_HEX = {
6
+ "blue": "#2563eb",
7
+ "green": "#16a34a",
8
+ "amber": "#d97706",
9
+ "violet": "#7c3aed",
10
+ "emerald": "#059669",
11
+ "teal": "#0d9488",
12
+ "cyan": "#0891b2",
13
+ "sky": "#0284c7",
14
+ "indigo": "#4f46e5",
15
+ "purple": "#9333ea",
16
+ "pink": "#db2777",
17
+ "rose": "#e11d48",
18
+ "red": "#dc2626",
19
+ "orange": "#ea580c",
20
+ "yellow": "#ca8a04",
21
+ "lime": "#65a30d",
22
+ "slate": "#334155",
23
+ "gray": "#4b5563",
24
+ "zinc": "#52525b",
25
+ "neutral": "#525252",
26
+ "stone": "#57534e",
27
+ }
28
+
29
+
30
+ def _default_menu_tabs() -> list[dict[str, str]]:
31
+ return [
32
+ {
33
+ "label": "Dashboard",
34
+ "url_name": "admin:index",
35
+ "icon": "layout-grid",
36
+ }
37
+ ]
38
+
39
+
40
+ @dataclass(frozen=True)
41
+ class ForgeSettings:
42
+ brand_name: str = "Forge Admin"
43
+ brand_logo_text: str = "FORGE"
44
+ brand_tagline: str = "Modern Django operations panel"
45
+ accent_color: str = "blue"
46
+ default_theme: str = "system" # light | dark | system
47
+ show_sidebar_search: bool = True
48
+ enable_command_bar: bool = True
49
+ menu_icons: dict[str, str] = field(default_factory=dict)
50
+ menu_tabs: list[dict[str, str]] = field(default_factory=_default_menu_tabs)
51
+ dashboard_analytics_cards: list[dict] = field(default_factory=list)
52
+
53
+ def as_context(self) -> dict:
54
+ data = asdict(self)
55
+ accent_name = (self.accent_color or "blue").lower()
56
+ data["accent_hex"] = ACCENT_HEX.get(accent_name, ACCENT_HEX["blue"])
57
+ data["accent_color"] = accent_name
58
+ return data
59
+
60
+
61
+ def get_forge_settings() -> ForgeSettings:
62
+ user_settings = getattr(settings, "DJANGO_ADMIN_FORGE", {})
63
+ valid_keys = {field.name for field in ForgeSettings.__dataclass_fields__.values()}
64
+ filtered = {key: value for key, value in user_settings.items() if key in valid_keys}
65
+ return ForgeSettings(**filtered)