Hello Developers✌,
In this tutorial you are going to learn how you can customize Django Admin site by itself.
First install 3rd party package called django-admin-interface
pip install django-admin-interface
Add package to installed apps in settings.py
file.
# project/settings.py
INSTALLED_APPS = [
# Add package before the django.contrib.admin
'admin_interface',
'colorfield',
# django apps
'django.contrib.admin',
...
]
Add following at bottom of settings.py
file.
X_FRAME_OPTIONS = "SAMEORIGIN"
SILENCED_SYSTEM_CHECKS = ["security.W019"]
Run migrate to apply migrations.
py manage.py migrate
then collect the static files.
py manage.py collectstatic
If you do not have configured static settings then update your settings.py
file like following.
STATIC_URL = '/static/'
STATICFILES_DIRS = (str(BASE_DIR.joinpath('static')),)
STATIC_ROOT = str(BASE_DIR.joinpath('staticfiles'))
STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
]
then run the server.
py manage.py runserver
Go to localhost:8000/admin
Click on the themes
model.
click on the django entry to update the admin interface.
You will see there are so many options to update the UI.
Change the colors, title, logo, etc. as you like.
Top comments (0)