aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Stanek <dstanek@dstanek.com>2012-11-04 07:19:49 -0500
committerDavid Stanek <dstanek@dstanek.com>2012-11-04 07:25:24 -0500
commit9837da08416b3afba0c594b3f1b71795c9576654 (patch)
tree42864172b7da60b70f283db858e3f5320ca63d59
parent3584f33f468ac027390b6312e93b2b55d06da740 (diff)
downloaddjango-precompiler-9837da08416b3afba0c594b3f1b71795c9576654.tar.bz2
django-precompiler-9837da08416b3afba0c594b3f1b71795c9576654.tar.xz
django-precompiler-9837da08416b3afba0c594b3f1b71795c9576654.zip
some hello world steps1.hello
-rw-r--r--README.md29
-rw-r--r--codemash/templates/index.html22
2 files changed, 26 insertions, 25 deletions
diff --git a/README.md b/README.md
index c08f893..1899655 100644
--- a/README.md
+++ b/README.md
@@ -2,28 +2,39 @@
2CodeMash 2012 Django Precompiler 2CodeMash 2012 Django Precompiler
3================================ 3================================
4 4
5
6Step 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
11create requirements.txt 15
16Step 2: Starting a new project
17==============================
18
19Student 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
22yay, django default page! now let's setup a template 27yay, django default page!
28
29
30Step 3: Hello Codemash!
31=======================
32
33now let's setup a template
23 34
24 $ mkdir codemash/templates 35 $ mkdir codemash/templates
25 36
26create codemash/templates/index.html 37Student creates codemash/templates/index.html show very, very barebones HTML on the slide
27 38
28edit codemash/settings.py 39edit 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
33edit codemash/urls.py 44edit codemash/urls.py
45
46yay, 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>