Reputation: 93
Currently created a templates folder inside my project folder.
Then I added the admin folder and the file base_site.html
to be able to change the Django admin title:
Home / Django / mysite / templates / admin / base_site.html
However, it doesn't change. My settings.py
file below:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'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',
],
},
},
]
Of Avinash Raj's request:
urls.py:
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
]
views.py:
from django.shortcuts import render
Upvotes: 0
Views: 539
Reputation: 1634
Since Django 1.7 you do not need to rewrite any templates to change admin title or header but just set site_header
, site_title
, and index_title
in admin.py
& then hook them in urls.py
. Look here: https://stackoverflow.com/a/24983231/5253807
Upvotes: 1