Welcome to django-haveli-admin’s documentation!¶
If you wanted to improve the django default theme to make the admin panel better then you can use django-haveli-admin in your project.
Requirements¶
- Django: 2.1 or above
Getting Started¶
Installation¶
You can get stable version of Django Haveli Admin by using pip or easy_install:
pip install django_haveli_admin
You will need to add the
'django_haveli_admin'
application to theINSTALLED_APPS
setting of your Django projectsettings.py
file:INSTALLED_APPS = [ ... 'django_haveli_admin', 'django.contrib.admin', ]
Important
'django_haveli_admin'
must be added before 'django.contrib.admin'
and if you are using third-party apps with special admin support.
Deployment¶
Deployment with Django Haveli Admin should not be different than any other Django application. If you have problems with deployment on production, read Django docs on wsgi first.
Note
If you deploy your project with Apache or Debug=False
don’t forget to run ./manage.py collectstatic
.
Configurations¶
App Icon in Sidebar¶
Add SHOW_NAV_APP_ICON
in settings.py
with boolean value True
or False
to enable to disable the app icon in sidebar menu. By default value of SHOW_NAV_APP_ICON
is False
to enable the icon set value to True
.:
SHOW_NAV_APP_ICON = True
Brand Image¶
If you wanted to add a brand image instead of header title in brand secttion.
Then add the value for SHOW_BRAND_IMAGE
in settings.py
as True
or False
to show
brand image in hader or not. Once you set the value SHOW_BRAND_IMAGE = True
add the path in BRAND_IMAGE
.:
SHOW_BRAND_IMAGE = True
BRAND_IMAGE = "/images/branding.png"
Note
Image path given in BRAND_IMAGE
is relative path to STATIC
folder.
Examples:¶
In settings.py
:
# Brand Image
SHOW_BRAND_IMAGE = True
BRAND_IMAGE = "/images/branding.png"
# To show app icon in sidebar
SHOW_NAV_APP_ICON = True
App Config¶
App Icon for Sidebar¶
To add the icon in sidebar for each app use icon
attribute in AppConfig
for each app in your_app/apps.py
. In icon
attribute path of the image will
be stored.:
icon = 'images/auth_icon.png'
Note
Image path stored in icon
should be relative path to STATIC
file path value set in settings.py
.
Example (in your_app/apps.py
):
from django.apps import AppConfig
class TestAppConfig(AppConfig):
name = 'test_app'
icon = 'images/auth_icon.png' # path realtive to static path set
Note
Make sure you have set the configuration SHOW_NAV_APP_ICON=True
in settings.py
to display icon in sidebar.
Links¶
- Django doc: https://docs.djangoproject.com/en/3.1/
- Package: https://pypi.org/project/django-haveli-admin/