aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 1899655e29bc216783dd8bc5836d192b18c69324 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
================================
CodeMash 2012 Django Precompiler
================================


Step 1: Creating a virtualized Python environment
=================================================

    $ virtualenv django-precompiler
    $ cd django-precompiler
    $ source bin/activate
    $ git init src
    $ cd src


Step 2: Starting a new project
==============================

Student creates requirements.txt

    $ pip install -r requirements.txt

    $ django-admin.py startproject codemash .
    $ chmod +x manage.py
    $ ./manage.py runserver

yay, django default page!


Step 3: Hello Codemash!
=======================

now let's setup a template

    $ mkdir codemash/templates

Student creates codemash/templates/index.html show very, very barebones HTML on the slide

edit codemash/settings.py
- import os
- add PROJECT_DIR
- update TEMPLATE_DIRS

edit codemash/urls.py

yay, Hello Codemash!

## tag: 1.hello