aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md8
-rw-r--r--codemash/templates/base.html11
-rw-r--r--codemash/templates/index.html18
3 files changed, 27 insertions, 10 deletions
diff --git a/README.md b/README.md
index 1899655..8e57b27 100644
--- a/README.md
+++ b/README.md
@@ -46,3 +46,11 @@ edit codemash/urls.py
46yay, Hello Codemash! 46yay, Hello Codemash!
47 47
48## tag: 1.hello 48## tag: 1.hello
49
50
51Step 3: Getting ready for a bigger project
52==========================================
53
54Student create a base.html
55
56Student modifies index.html to inherit from base.html
diff --git a/codemash/templates/base.html b/codemash/templates/base.html
new file mode 100644
index 0000000..bb85256
--- /dev/null
+++ b/codemash/templates/base.html
@@ -0,0 +1,11 @@
1<!DOCTYPE html>
2<html>
3 <head>
4 <title>Hello Codemash: {% block title %}TODO: add custom content using child templates{% endblock %}</title>
5 </head>
6 <body>
7 <div id="header">...header...</div>
8 {% block main %}TODO: add custom content using child templates{% endblock %}
9 <div id="footer">...footer...</div>
10 </body>
11</html>
diff --git a/codemash/templates/index.html b/codemash/templates/index.html
index ba0a13a..29c949d 100644
--- a/codemash/templates/index.html
+++ b/codemash/templates/index.html
@@ -1,10 +1,8 @@
1<!DOCTYPE html> 1{% extends "base.html" %}
2<html> 2
3 <head> 3{% block title %}Hello{% endblock %}
4 <title>Hello Codemash!</title> 4
5 </head> 5{% block main %}
6 <body> 6 <h1>It worked!</h1>
7 <h1>It worked!</h1> 7 <h2>Congratulations on your second Django-powered page.</h2>
8 <h2>Congratulations on your second Django-powered page.</h2> 8{% endblock %}
9 </body>
10</html>