================================ 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 Step 3: Getting ready for a bigger project ========================================== Student create a base.html Student modifies index.html to inherit from base.html