[Django]-How to personalize the django admin templates?

3πŸ‘

βœ…

The best approach to modify the admin templates is create a copy of the templates inside your project.

  1. Create a directory templates inside your project.
  2. Copy the templates from django/contrib/admin/templates/ to your
    templates directory.
  3. Add the path of your templates directory to the settings.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

Leave a comment