diff options
-rw-r--r-- | README.md | 29 | ||||
-rw-r--r-- | codemash/templates/index.html | 22 |
2 files changed, 26 insertions, 25 deletions
@@ -2,28 +2,39 @@ | |||
2 | CodeMash 2012 Django Precompiler | 2 | CodeMash 2012 Django Precompiler |
3 | ================================ | 3 | ================================ |
4 | 4 | ||
5 | |||
6 | Step 1: Creating a virtualized Python environment | ||
7 | ================================================= | ||
8 | |||
5 | $ virtualenv django-precompiler | 9 | $ virtualenv django-precompiler |
6 | $ cd django-precompiler | 10 | $ cd django-precompiler |
7 | $ source bin/activate | 11 | $ source bin/activate |
8 | $ git init src | 12 | $ git init src |
9 | $ cd src | 13 | $ cd src |
10 | 14 | ||
11 | create requirements.txt | 15 | |
16 | Step 2: Starting a new project | ||
17 | ============================== | ||
18 | |||
19 | Student creates requirements.txt | ||
12 | 20 | ||
13 | $ pip install -r requirements.txt | 21 | $ pip install -r requirements.txt |
14 | 22 | ||
15 | $ django-admin.py startproject codemash | 23 | $ django-admin.py startproject codemash . |
16 | $ mv codemash/ codemash-base | ||
17 | $ mv codemash-base/* . | ||
18 | $ rm -rf codemash-base/ | ||
19 | $ chmod +x manage.py | 24 | $ chmod +x manage.py |
20 | $ ./manage.py runserver | 25 | $ ./manage.py runserver |
21 | 26 | ||
22 | yay, django default page! now let's setup a template | 27 | yay, django default page! |
28 | |||
29 | |||
30 | Step 3: Hello Codemash! | ||
31 | ======================= | ||
32 | |||
33 | now let's setup a template | ||
23 | 34 | ||
24 | $ mkdir codemash/templates | 35 | $ mkdir codemash/templates |
25 | 36 | ||
26 | create codemash/templates/index.html | 37 | Student creates codemash/templates/index.html show very, very barebones HTML on the slide |
27 | 38 | ||
28 | edit codemash/settings.py | 39 | edit codemash/settings.py |
29 | - import os | 40 | - import os |
@@ -31,3 +42,7 @@ edit codemash/settings.py | |||
31 | - update TEMPLATE_DIRS | 42 | - update TEMPLATE_DIRS |
32 | 43 | ||
33 | edit codemash/urls.py | 44 | edit codemash/urls.py |
45 | |||
46 | yay, Hello Codemash! | ||
47 | |||
48 | ## tag: 1.hello | ||
diff --git a/codemash/templates/index.html b/codemash/templates/index.html index c54237f..ba0a13a 100644 --- a/codemash/templates/index.html +++ b/codemash/templates/index.html | |||
@@ -1,24 +1,10 @@ | |||
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html lang="en"> | 2 | <html> |
3 | <head> | 3 | <head> |
4 | <meta http-equiv="content-type" content="text/html; charset=utf-8"> | 4 | <title>Hello Codemash!</title> |
5 | <style type="text/css"> | ||
6 | html * { padding:0; margin:0; } | ||
7 | body * { padding:10px 20px; } | ||
8 | body * * { padding:0; } | ||
9 | body { font:small sans-serif; } | ||
10 | body>div { border-bottom:1px solid #ddd; } | ||
11 | h1 { font-weight:normal; } | ||
12 | h2 { margin-bottom:.8em; } | ||
13 | #summary { background: #e0ebff; } | ||
14 | #summary h2 { font-weight: normal; color: #666; } | ||
15 | </style> | ||
16 | </head> | 5 | </head> |
17 | |||
18 | <body> | 6 | <body> |
19 | <div id="summary"> | 7 | <h1>It worked!</h1> |
20 | <h1>It worked!</h1> | 8 | <h2>Congratulations on your second Django-powered page.</h2> |
21 | <h2>Congratulations on your second Django-powered page.</h2> | ||
22 | </div> | ||
23 | </body> | 9 | </body> |
24 | </html> | 10 | </html> |