Skip to content

Commit f400be4

Browse files
committed
Reintroduce base_site.html to override individual template blocks
1 parent 71333b8 commit f400be4

13 files changed

Lines changed: 25 additions & 16 deletions

File tree

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ section).
9999

100100
## Custom Settings
101101

102-
You may override any of the default settings by creating the file
103-
`sample_project/override/settings.py`. It is strongly recommended that you only override the
102+
You may override any of the default settings by setting them in
103+
`sample_project/settings.py`. It is strongly recommended that you only override the
104104
settings you need by importing the default settings and replacing only the
105105
values needed for your customizations:
106106

@@ -110,13 +110,14 @@ values needed for your customizations:
110110

111111
### Site-wide Changes
112112

113-
All pages inherit from the `base.html` template. To change every page on the site simply edit (`sample_project/templates/base.html`) and override
113+
All pages inherit from the `base.html` template. To change every page on the site
114+
simply edit (`sample_project/templates/codespeed/base_site.html`) and override
114115
the appropriate block:
115116

116117
* Custom title: you may replace the default "My Speed Center" for the title
117118
block with your prefered value:
118119

119-
{% block title}
120+
{% block title %}
120121
My Project's Speed Center
121122
{% endblock %}
122123

@@ -146,7 +147,7 @@ same name.
146147

147148
* About page: create `sample_project/override/templates/about.html`:
148149

149-
{% extends "base.html" %}
150+
{% extends "codespeed/base_site.html" %}
150151
{% block title %}{{ block.super }}: About this project{% endblock %}
151152
{% block body %}
152153
<div id="sidebar"></div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% extends "codespeed/base.html" %}
2+
3+
{# This exists only to be overriden #}

codespeed/templates/codespeed/changes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "base.html" %}
1+
{% extends "codespeed/base_site.html" %}
22
{% load url from future %}
33
{% block title %}{{ block.super }}: Changes{% endblock %}
44

codespeed/templates/codespeed/comparison.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "base.html" %}
1+
{% extends "codespeed/base_site.html" %}
22
{% load url from future %}
33
{% block title %}{{ block.super }}: Comparison{% endblock %}
44

codespeed/templates/codespeed/nodata.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "base.html" %}
1+
{% extends "codespeed/base_site.html" %}
22
{% block body %}
33
<div id="presentation_wrapper">
44
<p>{{ message|safe }}</p>

codespeed/templates/codespeed/timeline.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "base.html" %}
1+
{% extends "codespeed/base_site.html" %}
22
{% load url from future %}
33
{% block title %}{{ block.super }}: Timeline{% endblock %}
44

sample_project/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,22 @@ Assumed you have a [Debian](http://www.debian.org) like system.
110110

111111
### Using your own Templates
112112
Just edit your very own Django templates in `speedcenter/templates`. A good
113-
start is `base.html` the root of all templates.
113+
start is `codespeed/base.html` the root of all templates.
114114

115115
If you need to change the codespeed templates:
116116
1. Copy the templates from the codespeed module into your Django project folder.
117117
`cp -r codespeed/templates/codespeed speedcenter/templates/`
118118
2. Edit the templates in speedcenter/templates/codespeed/*html
119119
Please, also refer to the [Django template docu]
120-
(http://docs.djangoproject.com/en/1.3/ref/templates/)
120+
(http://docs.djangoproject.com/en/1.4/ref/templates/)
121121

122122
### Changing the URL Scheme
123123
If you don't want to have your speedcenter in the root url you can change urls.py.
124124
Comment (add a '#' at the beginning) line number 25 `(r'^', include('cod...`
125125
and uncomment the next line `(r'^speed/', include('cod...` (Note, Python is
126126
picky about indentation).
127127
Please, also refer to the [Django URL dispatcher docu]
128-
(http://docs.djangoproject.com/en/1.3/topics/http/urls/).
128+
(http://docs.djangoproject.com/en/1.4/topics/http/urls/).
129129

130130
### Codespeed settings
131131
The main config file is `settings.py`. There you configure everything related

sample_project/templates/404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "base.html" %}
1+
{% extends "codespeed/base_site.html" %}
22

33
{% block title %}Page not found{% endblock %}
44

sample_project/templates/500.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "base.html" %}
1+
{% extends "codespeed/base_site.html" %}
22

33
{% block title %}Page unavailable{% endblock %}
44

0 commit comments

Comments
 (0)