How do I override Django's default admin templates and layouts
<p>I am trying to override Django's default template. For now just the base_site.html. I'm trying to change the text django administration.</p>

<p>I did the following:</p>

<ol>
<li>I created a folder in my app directory <code>/opt/mydjangoapp/templates/admin</code></li>
<li>I then copied the original django admin templates folder contents into admin and here are the contents:
<em>404.html        auth              change_list.html          delete_selected_confirmation.html  index.html           pagination.html              search_form.html
500.html        base.html         change_list_results.html  edit_inline                        invalid_setup.html   popup_response.html          submit_line.html
actions.html    base_site.html    date_hierarchy.html       filter.html                        login.html           prepopulated_fields_js.html
app_index.html  change_form.html  delete_confirmation.html  includes                           object_history.html  related_widget_wrapper.html</em></li>
<li>I changed the contents of <code>base_site.html</code>, so that I have the title '<em>My App Admin</em>' as opposed to '<em>Django Administration</em>'</li>
<li><p>My settings file looks as follows:  </p>

<pre><code>INSTALLED_APPS = (
    'mydjangoapp',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'debug_toolbar',
)

...

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': ['/opt/mydjangoapp/templates/'],
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
            'debug':True,
            'loaders': (
                 'django.template.loaders.filesystem.Loader',
                 'django.template.loaders.app_directories.Loader'
            ),
        },
    },
]
</code></pre></li>
</ol>

<p>But unfortunately, Django version 1.8 seems to be ignoring my template changes and loading the original template files. Any suggestions as to how I can override the original layout for the admin. Bare in mind changing the title is just the beginning of the changes that I want to perform?</p>

<p>First, make sure your application is listed first, because Django always take the resources from the first application where it finds them, according to the order in <code>settings.INSTALLED_APPS</code>.</p>

<p>In this case the app was listed first, but the override was not working because the templates were placed under the global template directories listed under <code>settings.TEMPLATES['DIRS']</code> which are not tied to any particular app and will have the least priority.</p>

<p>If this is your case, you must move the template folder inside your app (for example, <code>/opt/mydjangoapp/mydjangoapp/templates/</code> instead of <code>/opt/mydjangoapp/templates/</code>) and wipe the reference at <code>settings.TEMPLATES['DIRS']</code>. </p>

python django