...

/

Customising the Admin Template

Customising the Admin Template

Learn about the basics of adding a custom template to your Django admin page.

We'll cover the following...

Customising admin templates

To override or replace Django admin templates, you first need to configure your project to tell Django where to find your custom templates. To do so, you need to define the path in the DIRS option of the TEMPLATES parameter, which is located in helloworld/settings.py.

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            BASE_DIR,
            os.path.join(BASE_DIR, 'templates')
        ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
               
...