This content originally appeared on DEV Community and was authored by Vijay Soni
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.
This content originally appeared on DEV Community and was authored by Vijay Soni
Vijay Soni | Sciencx (2022-07-10T09:44:32+00:00) How to customize Django Admin site by itself ?. Retrieved from https://www.scien.cx/2022/07/10/how-to-customize-django-admin-site-by-itself/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.