3π
β
The best approach to modify the admin templates is create a copy of the templates inside your project.
- Create a directory
templates
inside your project. - Copy the templates from
django/contrib/admin/templates/
to your
templates
directory. - Add the path of your
templates
directory to thesettings.py
settings.py
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, '..', 'templates),
)
Now you can modify to the admin templates without affect other dependent projects.
π€ifm
0π
If you run the collectstatic
command for the particular project you should be able to change the admin templates that are copied to the static directory you have specified in your project settings.
π€Ernest Jumbe
- [Django]-Using prefetch_related to get only a particular entry of a relation
- [Django]-In a Django serializer, take default field value from context (or request data)
- [Django]-Django β copy header from admin to all templates
- [Django]-Displaying check mark and cross instead of boolean TRUE and False?
- [Django]-Exposing MoneyFields in Django REST Framework?
Source:stackexchange.com