Skip to content

Commit 3a9bb28

Browse files
committed
django tutorial: End of part 2. Custom template for the admin page.
1 parent dc5d8ff commit 3a9bb28

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

mysite/mysite/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
TEMPLATES = [
5858
{
5959
'BACKEND': 'django.template.backends.django.DjangoTemplates',
60-
'DIRS': [],
60+
'DIRS': [os.path.join(BASE_DIR, 'templates')],
6161
'APP_DIRS': True,
6262
'OPTIONS': {
6363
'context_processors': [

mysite/templates/admin/base_site.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% extends "admin/base.html" %}
2+
3+
{% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}
4+
5+
{% block branding %}
6+
<h1 id="site-name"><a href="{% url 'admin:index' %}">Polls Administration</a></h1>
7+
8+
{% endblock %}
9+
10+
{% block nav-global %}{% endblock %}

0 commit comments

Comments
 (0)