Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
yaghoubi committed Nov 30, 2024
1 parent f521d0e commit 1a3aa07
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 71 deletions.
77 changes: 71 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ https://hypy13-django-daisy.hf.space/fa/admin/

---



Django Daisy is a modern, sleek, and highly responsive admin dashboard built with **DaisyUI** and **TailwindCSS**. It brings a polished and user-friendly interface that scales beautifully across devices, from mobile to desktop, making your admin experience fast and efficient.


Expand Down Expand Up @@ -71,8 +69,79 @@ INSTALLED_APPS = [

Once you've made these changes, enjoy the fresh new theme!

---
Here's a refined version of your README file with a more polished structure and explanation for each section:

---

# Project Customizations

## 1. App Configuration in `apps.py`

You can configure app-specific settings in the `apps.py` file for each application within your Django project. Below is an example of how to customize the `Polls` app:

```python
class PollsConfig(AppConfig):
name = 'polls' # The name of the app
icon = 'fa fa-square-poll-vertical' # FontAwesome icon for the app (optional)
divider_title = "Apps" # Title of the section divider in the sidebar (optional)
priority = 0 # Determines the order of the app in the sidebar (higher values appear first, optional)
hide = False # Set to True to hide the app from the sidebar menu (optional)
```

### Explanation:
- **name**: The name of the app.
- **icon**: An optional FontAwesome icon to display next to the app name in the sidebar.
- **divider_title**: The title for the section divider, grouping similar apps together (optional).
- **priority**: An optional setting that controls the order of apps in the sidebar; higher values appear at the top.
- **hide**: If set to `True`, the app will be hidden from the sidebar menu.

---

## 2. Global Customizations in `settings.py`

You can define various project-wide settings for customizing the Django admin interface in your `settings.py` file using the `DAISY_SETTINGS` dictionary. Below is an example configuration:

```python
DAISY_SETTINGS = {
'SITE_TITLE': 'Django Admin', # The title of the site
'SITE_HEADER': 'Administration', # Header text displayed in the admin panel
'INDEX_TITLE': 'Hi, welcome to your dashboard', # The title for the index page of dashboard
'SITE_LOGO': '/static/admin/img/daisyui-logomark.svg', # Path to the logo image displayed in the sidebar
'EXTRA_STYLES': [], # List of extra stylesheets to be loaded in base.html (optional)
'EXTRA_SCRIPTS': [], # List of extra script URLs to be loaded in base.html (optional)
'LOAD_FULL_STYLES': False, # If True, loads full DaisyUI components in the admin (useful if you have custom template overrides)
'SHOW_CHANGELIST_FILTER': False, # If True, the filter sidebar will open by default on changelist views
'APPS_REORDER': {
# Custom configurations for third-party apps that can't be modified directly in their `apps.py`
'auth': {
'icon': 'fa-solid fa-person-military-pointing', # FontAwesome icon for the 'auth' app
'name': 'Authentication', # Custom name for the 'auth' app
'hide': False, # Whether to hide the 'auth' app from the sidebar (set to True to hide)
'app': 'users', # The actual app to display in the sidebar (e.g., rename 'auth' to 'users')
'divider_title': "Auth", # Divider title for the 'auth' section
},
'social_django': {
'icon': 'fa-solid fa-users-gear', # Custom FontAwesome icon for the 'social_django' app
},
},
}
```

### Explanation:
- **SITE_TITLE**: Sets the title of your site (visible in the browser tab).
- **SITE_HEADER**: The header displayed at the top of the Django admin interface.
- **INDEX_TITLE**: The title shown on the dashboard page of the admin panel.
- **SITE_LOGO**: Specifies the path to a logo image that appears in the sidebar.
- **EXTRA_STYLES**: A list of additional CSS files to be loaded into the admin interface (useful for custom styling).
- **EXTRA_SCRIPTS**: A list of additional JavaScript files to be loaded into the admin interface.
- **LOAD_FULL_STYLES**: If set to `True`, loads the full DaisyUI library for styling, which can be useful if you have overridden the admin templates.
- **SHOW_CHANGELIST_FILTER**: Controls whether the changelist filter sidebar is shown by default.
- **APPS_REORDER**: This allows you to reorder, customize, and modify third-party apps. For example, you can change the name of the `auth` app to `users`, provide a custom icon, or hide it from the sidebar entirely.

---


## 🤝 Contributing

We welcome contributions from the community! Feel free to submit any issues, suggestions, or pull requests to help improve Django Daisy.
Expand All @@ -84,13 +153,9 @@ We welcome contributions from the community! Feel free to submit any issues, sug
##### Listing View:
![Listing View](https://raw.githubusercontent.com/hypy13/django-daisy/refs/heads/main/screenshots/listing.png)


##### Change Form:
![Listing View](https://raw.githubusercontent.com/hypy13/django-daisy/refs/heads/main/screenshots/change_form.png)

##### InlineAdmin Change Form:
![Listing View](https://raw.githubusercontent.com/hypy13/django-daisy/refs/heads/main/screenshots/inline_admin.png)

##### Mobile Responsive:
![Listing View](https://raw.githubusercontent.com/hypy13/django-daisy/refs/heads/main/screenshots/mobile.png)

Expand Down
2 changes: 1 addition & 1 deletion build-styles/base_tailwind.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind utilities;
1 change: 1 addition & 0 deletions build-styles/customized_tailwind.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

*:focus-visible {
outline: none !important;
}
Expand Down
2 changes: 1 addition & 1 deletion django_daisy/static/admin/css/base_tailwind.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion django_daisy/templates/admin/change_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
</div>

{% block submit_buttons_bottom %}
<div class="w-full z-40 sticky max-lg:fixed max-lg:-ml-5 bottom-0 ">
<div class="w-full z-40 sticky max-lg:fixed max-lg:-mx-3 bottom-0 ">
{% submit_row %}
</div>
{% endblock %}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"description": "",
"main": "index.js",
"scripts": {
"base": "npx tailwindcss -i build-styles/base_tailwind.css -o django_daisy/static/admin/css/base_tailwind.css --minify",
"watch": "npx tailwindcss -i build-styles/customized_tailwind.css -o django_daisy/static/admin/css/customized_tailwind.css --minify --watch"
"build:base": "npx tailwindcss -i build-styles/base_tailwind.css -o django_daisy/static/admin/css/base_tailwind.css --minify",
"build:customise": "npx tailwindcss -i build-styles/customized_tailwind.css -o django_daisy/static/admin/css/customized_tailwind.css --minify",
"watch": "npm run build:base -- --watch"
},
"keywords": [],
"author": "",
Expand Down
Binary file modified screenshots/change_form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/dark_theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed screenshots/inline_admin.png
Binary file not shown.
Binary file modified screenshots/listing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 0 additions & 60 deletions tailwind.config2.js

This file was deleted.

0 comments on commit 1a3aa07

Please sign in to comment.