Skip to content

Commit 3ff0755

Browse files
committed
v1.0.4 - Fix for Django 5 & Links Update
1 parent cbd30cf commit 3ff0755

File tree

5 files changed

+24
-150
lines changed

5 files changed

+24
-150
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ __pycache__/
1111
build/
1212
develop-eggs/
1313

14+
dist/
1415
downloads/
1516
eggs/
1617
.eggs/

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# CHANGELOG
22

3+
## [1.0.4] 2024-11-16
4+
### Changes
5+
6+
- Remove `length_is` filter
7+
- Deprecated in Django 5.1
8+
- Update RM Links:
9+
- [Django Modernize](https://app-generator.dev/docs/products/django-libs/theme-modernize.html) - **Documentation** & Support Links
10+
- [Getting Started with Django](https://app-generator.dev/docs/technologies/django/index.html) - Learn how to code **Django** Projects
11+
312
## [1.0.3] 2023-05-01
413
### Changes
514

README.md

Lines changed: 8 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
# [Django Admin Modernize](https://github.com/app-generator/django-modernize)
1+
# [Django Modernize](https://app-generator.dev/docs/products/django-libs/theme-modernize.html)
22

3-
Modern template for **Django** that covers `Admin Section`, all authentication pages (registration included) crafted on top of **Modernize**, an open-source `Bootstrap 5` design from [AdminMart](https://adminmart.com/?ref=1).
3+
Modern template for **[Django Admin](https://app-generator.dev/docs/products/django-libs/theme-modernize.html)**, Auth Pages (registration included) crafted on top of **Modernize**, an open-source **Bootstrap** design.
44

5-
> Actively supported by [AppSeed](https://appseed.us/) via `Email` and `Discord`.
5+
- [Django Modernize](https://app-generator.dev/docs/products/django-libs/theme-modernize.html) - **Documentation** & Support Links
6+
- [Getting Started with Django](https://app-generator.dev/docs/technologies/django/index.html) - Learn how to code **Django** Projects
67

78
<br />
89

9-
**Links & Resources**
10+
## **Features**
1011

11-
- [Django Modernize](https://django-modernize.onrender.com/) - `LIVE Demo`
12-
- `Features`: Fully-configured, `CI/CD` via Render
13-
- UI Kit: [Modernize](https://adminmart.com/product/modernize-free-bootstrap-5-admin-template/?ref=1) by `AdminMart`
12+
- Design: Modernize Bootstrap 5
1413
- **Sections Covered**:
1514
- `Admin Section`, reserved for `superusers`
1615
- `All pages` managed by `Django.contrib.AUTH`
@@ -19,144 +18,9 @@ Modern template for **Django** that covers `Admin Section`, all authentication p
1918

2019
<br />
2120

22-
![Modernize - Bootstrap 5 design](https://user-images.githubusercontent.com/51070104/235424939-6b5b1d1d-0832-457a-82a9-599ba532da52.jpg)
23-
24-
<br />
25-
26-
## Why `Django Admin Modernize`
27-
28-
- Modern [Bootstrap 5](https://www.admin-dashboards.com/bootstrap-5-templates/) Design
29-
- `Responsive Interface`
30-
- `Minimal Template` overriding
31-
- `Easy integration`
32-
33-
<br />
34-
35-
## How to use it
36-
37-
<br />
38-
39-
> **Install the package** via `PIP`
40-
41-
```bash
42-
$ pip install django-admin-modernize
43-
// OR
44-
$ pip install git+https://github.com/app-generator/django-admin-modernize.git
45-
```
46-
47-
<br />
48-
49-
> Add `admin_modernize` application to the `INSTALLED_APPS` setting of your Django project `settings.py` file (note it should be before `django.contrib.admin`):
50-
51-
```python
52-
INSTALLED_APPS = (
53-
...
54-
'admin_modernize.apps.AdminModernizeConfig',
55-
'django.contrib.admin',
56-
)
57-
```
58-
59-
<br />
60-
61-
> Add `LOGIN_REDIRECT_URL` and `EMAIL_BACKEND` of your Django project `settings.py` file:
62-
63-
```python
64-
LOGIN_REDIRECT_URL = '/'
65-
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
66-
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
67-
```
68-
69-
<br />
70-
71-
> Add `admin_modernize` urls in your Django Project `urls.py` file
72-
73-
```python
74-
from django.urls import path, include
75-
76-
urlpatterns = [
77-
...
78-
path('', include('admin_modernize.urls')),
79-
]
80-
```
81-
82-
<br />
83-
84-
> **Collect static** if you are in `production environment`:
85-
86-
```bash
87-
$ python manage.py collectstatic
88-
```
89-
90-
<br />
91-
92-
> **Start the app**
93-
94-
```bash
95-
$ # Set up the database
96-
$ python manage.py makemigrations
97-
$ python manage.py migrate
98-
$
99-
$ # Create the superuser
100-
$ python manage.py createsuperuser
101-
$
102-
$ # Start the application (development mode)
103-
$ python manage.py runserver # default port 8000
104-
```
105-
106-
Access the `admin` section in the browser: `http://127.0.0.1:8000/`
107-
108-
<br />
109-
110-
## How to Customize
111-
112-
When a template file is loaded, `Django` scans all template directories starting from the ones defined by the user, and returns the first match or an error in case the template is not found.
113-
The theme used to style this starter provides the following files:
114-
115-
```bash
116-
# This exists in ENV: LIB/admin_modernize
117-
< UI_LIBRARY_ROOT >
118-
|
119-
|-- templates/ # Root Templates Folder
120-
| |
121-
| |-- accounts/
122-
| | |-- login.html # Sign IN Page
123-
| | |-- register.html # Sign UP Page
124-
| |
125-
| |-- includes/
126-
| | |-- footer.html # Footer component
127-
| | |-- sidebar.html # Sidebar component
128-
| | |-- navigation.html # Navigation Bar
129-
| | |-- scripts.html # Scripts Component
130-
| |
131-
| |-- layouts/
132-
| | |-- base.html # Masterpage
133-
| | |-- base-auth.html # Masterpage for Auth Pages
134-
| |
135-
| |-- pages/
136-
| |-- index.html # Dashboard Page
137-
| |-- profile.html # Profile Page
138-
| |-- *.html # All other pages
139-
|
140-
|-- ************************************************************************
141-
```
142-
143-
When the project requires customization, we need to copy the original file that needs an update (from the virtual environment) and place it in the template folder using the same path.
144-
145-
For instance, if we want to customize the `footer.html` these are the steps:
146-
147-
- `Step 1`: create the `templates` DIRECTORY inside your app
148-
- `Step 2`: configure the project to use this new template directory
149-
- Edit `settings.py` TEMPLATES section
150-
- `Step 3`: copy the `footer.html` from the original location (inside your ENV) and save it to the `YOUR_APP/templates` DIR
151-
- Source PATH: `<YOUR_ENV>/LIB/admin_modernize/templates/includes/footer.html`
152-
- Destination PATH: `YOUR_APP/templates/includes/footer.html`
153-
- Edit the `footer.html` (Destination PATH)
154-
155-
At this point, the default version of the `footer.html` shipped in the library is ignored by Django.
156-
157-
In a similar way, all other files and components can be customized easily.
21+
![Django Modernize - Modern template for Django Admin Section crafted on top of a modern Bootstrap, Open-Source Design.](https://github.com/user-attachments/assets/afdb4417-1aa0-4cdd-9929-2f1efc7c18a4)
15822

15923
<br />
16024

16125
---
162-
**[Django Admin Modernize](https://github.com/app-generator/django-modernize)** - Modern Admin Interface provided by **[AppSeed](https://appseed.us/)**
26+
**[Django Modernize](https://app-generator.dev/docs/products/django-libs/theme-modernize.html)** - Modern Django Admin Interface provided by **[App-Generator](https://app-generator.dev)**

admin_modernize/templates/admin/includes/fieldset.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
{% for line in fieldset %}
88
<div class="row">
99
<div class="{% if line.fields.0 in 'last_login, date_joined' %}col-md-6{% else %}col-md-12{% endif %}">
10-
<div class="mb-4 {% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
11-
{% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %}
10+
<div class="mb-4 {% if line.fields|length == 1 and line.errors %} errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
11+
{% if line.fields|length == 1 %}{{ line.errors }}{% endif %}
1212
{% for field in line %}
13-
{# <div{% if not line.fields|length_is:'1' %} class="fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>#}
13+
{# <div{% if not line.fields|length == 1 %} class="fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>#}
1414

15-
{% if not line.fields|length_is:'1' and not field.is_readonly %}
15+
{% if not line.fields|length == 1 and not field.is_readonly %}
1616
{{ field.errors }}
1717
{% endif %}
1818

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
setup(
1010
name='django-admin-modernize',
11-
version='1.0.3',
11+
version='1.0.4',
1212
zip_safe=False,
1313
packages=find_packages(),
1414
include_package_data=True,
1515
description='Modern template for Django admin interface',
1616
long_description=README,
1717
long_description_content_type="text/markdown",
18-
url='https://github.com/app-generator/django-modernize',
18+
url='https://app-generator.dev/docs/products/django-libs/theme-modernize.html',
1919
author='AppSeed.us',
2020
author_email='[email protected]',
2121
license='MIT License',

0 commit comments

Comments
 (0)