Commits

Yann Malet committed ff98afe

Initial commit with the source of the django tutorial

Comments (0)

Files changed (38)

+Developer documentation is available in Sphinx format in the docs directory.
+
+Initial installation instructions (including how to build the documentation as
+HTML) can be found in docs/install.rst.

django_tutorial/__init__.py

Empty file added.

django_tutorial/apps/__init__.py

Empty file added.

django_tutorial/apps/polls/__init__.py

Empty file added.

django_tutorial/apps/polls/admin.py

+from django.contrib import admin
+
+from .models import Poll, Choice
+
+
+class ChoiceInline(admin.TabularInline):
+    model = Choice
+    extra = 3
+
+class PollAdmin(admin.ModelAdmin):
+    fieldsets = [
+        (None,               {'fields':['question']}),
+        ('Date Information', {'fields':['pub_date'], 'classes':  ['collapse']})
+    ]
+    inlines = [ChoiceInline]
+    list_display   = ('question', 'pub_date', 'was_published_today')
+    lists_filter   = ['pub_date']
+    search_fields  = ['question']
+    date_hierarchy = 'pub_date'
+
+admin.site.register(Poll, PollAdmin)

django_tutorial/apps/polls/models.py

+from django.db import models
+import datetime
+
+
+class Poll(models.Model):
+    question = models.CharField(max_length=200)
+    pub_date = models.DateTimeField('date published')
+
+    def __unicode__(self):
+        return self.question
+
+    def was_published_today(self):
+        return self.pub_date.date() == datetime.date.today()
+    was_published_today.short_description = 'Published today?'
+
+
+class Choice(models.Model):
+    poll = models.ForeignKey(Poll)
+    choice = models.CharField(max_length=200)
+    votes = models.IntegerField()
+
+    def __unicode__(self):
+        return self.choice

django_tutorial/apps/polls/templates/polls/detail.html

+<h1>{{ poll.question }}</h1>
+
+{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
+
+<form action="/polls/{{ poll.id }}/vote/" method="post">
+{% csrf_token %}
+{% for choice in poll.choice_set.all %}
+    <input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" />
+    <label for="choice{{ forloop.counter }}">{{ choice.choice }}</label><br />
+{% endfor %}
+<input type="submit" value="Vote" />
+</form>

django_tutorial/apps/polls/templates/polls/index.html

+{% if latest_poll_list %}
+    <ul>
+    {% for poll in latest_poll_list %}
+        <li>
+        	<a href="/polls/{{ poll.id }}/">{{ poll.question }}</a>
+        </li>
+    {% endfor %}
+    </ul>
+{% else %}
+    <p>No polls are available.</p>
+{% endif %}

django_tutorial/apps/polls/templates/polls/poll_detail.html

+<h1>{{ poll.question }}</h1>
+
+<ul>
+{% for choice in poll.choice_set.all %}
+    <li>{{ choice.choice }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }}</li>
+{% endfor %}
+</ul>
+
+<a href="/polls/{{ poll.id }}/">Vote again?</a>

django_tutorial/apps/polls/templates/polls/result.html

+<h1>{{ poll.question }}</h1>
+
+<ul>
+{% for choice in poll.choice_set.all %}
+    <li>{{ choice.choice }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }}</li>
+{% endfor %}
+</ul>
+
+<a href="/polls/{{ poll.id }}/">Vote again?</a>

django_tutorial/apps/polls/tests.py

+"""
+This file demonstrates writing tests using the unittest module. These will pass
+when you run "manage.py test".
+
+Replace this with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+
+
+class SimpleTest(TestCase):
+    def test_basic_addition(self):
+        """
+        Tests that 1 + 1 always equals 2.
+        """
+        self.assertEqual(1 + 1, 2)

django_tutorial/apps/polls/urls.py

+from django.conf.urls.defaults import patterns, include, url
+from django.views.generic import DetailView, ListView
+
+from .views import vote
+
+from .models import Poll
+
+urlpatterns = patterns('',
+    (r'^$',
+        ListView.as_view(
+            queryset=Poll.objects.order_by('-pub_date')[:5],
+            context_object_name='latest_poll_list',
+            template_name='polls/index.html')),
+    (r'^(?P<pk>\d+)/$',
+        DetailView.as_view(
+            model=Poll,
+            template_name='polls/detail.html')),
+    url(r'^(?P<pk>\d+)/results/$',
+        DetailView.as_view(
+            model=Poll,
+            template_name='polls/results.html'),
+            name='poll_results'),
+    (r'^(?P<poll_id>\d+)/vote/$', vote),
+)

django_tutorial/apps/polls/views.py

+from django.shortcuts import render_to_response, get_object_or_404
+from django.http import HttpResponseRedirect, HttpResponse
+from django.core.urlresolvers import reverse
+from django.template import RequestContext
+
+from .models import Choice, Poll
+
+# def index(request):
+#   latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5]
+#   return render_to_response('polls/index.html', {'latest_poll_list' : latest_poll_list})
+
+# def detail(request, poll_id):
+#   p = get_object_or_404(Poll, pk=poll_id)
+#   return render_to_response('polls/detail.html', {'poll': p}, context_instance=RequestContext(request))
+
+# def results(request, poll_id):
+#   p = get_object_or_404(Poll, pk=poll_id)
+#   return render_to_response('polls/result.html', {'poll':p})
+
+def vote(request, poll_id):
+    p = get_object_or_404(Poll, pk=poll_id)
+    try:
+        selected_choice = p.choice_set.get(pk=request.POST['choice'])
+    except (KeyError, Choice.DoesNotExist):
+        # Redisplay the poll voting form.
+        return render_to_response('polls/detail.html', {
+            'poll': p,
+            'error_message': "didn't select a choice.",
+        }, context_instance = RequestContext(request))
+    else:
+        selected_choice.votes += 1
+        selected_choice.save()
+        # Always return an HttpResponseRedirect after successfully dealing
+        # with POST data. This prevents data from being posted twice if a
+        # user hits the Back button.
+        return HttpResponseRedirect(reverse('poll_results', args=(p.id,)))

django_tutorial/conf/__init__.py

Empty file added.

django_tutorial/conf/dev.py

+from django_tutorial.settings import *   # pylint: disable=W0614,W0401
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.postgresql_psycopg2',
+        'NAME': 'django_tutorial',
+#        'USER': 'dbuser',
+#        'PASSWORD': 'dbpassword',
+    }
+}
+
+WSGI_APPLICATION = 'django_tutorial.wsgi.dev.application'

django_tutorial/conf/local/__init__.py

+from django_tutorial.settings import *   # pylint: disable=W0614,W0401
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+ADMINS = (
+    ('You', 'your@email'),
+)
+MANAGERS = ADMINS
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': os.path.join(VAR_ROOT, 'dev.db'),
+    }
+}
+
+ROOT_URLCONF = 'django_tutorial.conf.local.urls'
+WSGI_APPLICATION = 'django_tutorial.wsgi.local.application'

django_tutorial/conf/local/example/__init__.py

+from django_tutorial.settings import *   # pylint: disable=W0614,W0401
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+ADMINS = (
+    ('You', 'your@email'),
+)
+MANAGERS = ADMINS
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': os.path.join(VAR_ROOT, 'dev.db'),
+    }
+}
+
+ROOT_URLCONF = 'django_tutorial.conf.local.urls'
+WSGI_APPLICATION = 'django_tutorial.wsgi.local.application'

django_tutorial/conf/local/example/urls.py

+from django.conf.urls.static import static
+from django.conf import settings
+
+from django_tutorial.urls import urlpatterns
+
+
+if settings.MEDIA_ROOT:
+    urlpatterns += static(settings.MEDIA_URL,
+        document_root=settings.MEDIA_ROOT)

django_tutorial/conf/local/urls.py

+from django.conf.urls.static import static
+from django.conf import settings
+
+from django_tutorial.urls import urlpatterns
+
+
+if settings.MEDIA_ROOT:
+    urlpatterns += static(settings.MEDIA_URL,
+        document_root=settings.MEDIA_ROOT)

django_tutorial/conf/test.py

+from django_tutorial.settings import *   # pylint: disable=W0614,W0401
+
+DEBUG = False
+TEMPLATE_DEBUG = DEBUG
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': ':memory:',
+    }
+}
+
+INSTALLED_APPS += (
+    'django_nose',
+)
+
+TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
+WSGI_APPLICATION = 'django_tutorial.wsgi.test.application'

django_tutorial/settings.py

+# Import global settings to make it easier to extend settings.
+from django.conf.global_settings import *   # pylint: disable=W0614,W0401
+
+#==============================================================================
+# Generic Django project settings
+#==============================================================================
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+SITE_ID = 1
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+TIME_ZONE = 'UTC'
+USE_TZ = True
+USE_I18N = True
+USE_L10N = True
+LANGUAGE_CODE = 'en'
+LANGUAGES = (
+    ('en', 'English'),
+)
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = 'jy7wd5g^-*w*6dqery*0t(5g%+ypj4jc^xwifwjp_&amp;9)zd347x'
+
+INSTALLED_APPS = (
+    'django_tutorial.apps.polls',
+
+    #'south',
+
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.messages',
+    'django.contrib.staticfiles',
+    'django.contrib.admin',
+    'django.contrib.admindocs',
+)
+
+#==============================================================================
+# Calculation of directories relative to the project module location
+#==============================================================================
+
+import os
+import sys
+import django_tutorial as project_module
+
+PROJECT_DIR = os.path.dirname(os.path.realpath(project_module.__file__))
+
+PYTHON_BIN = os.path.dirname(sys.executable)
+ve_path = os.path.dirname(os.path.dirname(os.path.dirname(PROJECT_DIR)))
+# Assume that the presence of 'activate_this.py' in the python bin/
+# directory means that we're running in a virtual environment.
+if os.path.exists(os.path.join(PYTHON_BIN, 'activate_this.py')):
+    # We're running with a virtualenv python executable.
+    VAR_ROOT = os.path.join(os.path.dirname(PYTHON_BIN), 'var')
+elif ve_path and os.path.exists(os.path.join(ve_path, 'bin',
+        'activate_this.py')):
+    # We're running in [virtualenv_root]/src/[project_name].
+    VAR_ROOT = os.path.join(ve_path, 'var')
+else:
+    # Set the variable root to the local configuration location (which is
+    # ignored by the repository).
+    VAR_ROOT = os.path.join(PROJECT_DIR, 'conf', 'local')
+
+if not os.path.exists(VAR_ROOT):
+    os.mkdir(VAR_ROOT)
+
+#==============================================================================
+# Project URLS and media settings
+#==============================================================================
+
+ROOT_URLCONF = 'django_tutorial.urls'
+
+LOGIN_URL = '/login/'
+LOGOUT_URL = '/logout/'
+LOGIN_REDIRECT_URL = '/'
+
+STATIC_URL = '/static/'
+MEDIA_URL = '/uploads/'
+
+STATIC_ROOT = os.path.join(VAR_ROOT, 'static')
+MEDIA_ROOT = os.path.join(VAR_ROOT, 'uploads')
+
+STATICFILES_DIRS = (
+    os.path.join(PROJECT_DIR, 'static'),
+)
+
+#==============================================================================
+# Templates
+#==============================================================================
+
+TEMPLATE_DIRS = (
+    os.path.join(PROJECT_DIR, 'templates'),
+)
+
+TEMPLATE_CONTEXT_PROCESSORS += (
+)
+
+#==============================================================================
+# Middleware
+#==============================================================================
+
+MIDDLEWARE_CLASSES += (
+)
+
+#==============================================================================
+# Auth / security
+#==============================================================================
+
+AUTHENTICATION_BACKENDS += (
+)
+
+#==============================================================================
+# Miscellaneous project settings
+#==============================================================================
+
+#==============================================================================
+# Third party app settings
+#==============================================================================

django_tutorial/static/.gitignore

Empty file added.

django_tutorial/templates/404.html

+{% extends "base.html" %}
+
+{% block content %}
+    Not Found
+{% endblock %}

django_tutorial/templates/500.html

+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html>
+<head>
+    <title>{% block head_title %}{% endblock %}</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+</head>
+<body>
+
+<div id="container">
+    Server Error
+</div>
+
+</body>
+</html>

django_tutorial/templates/base.html

+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html>
+<head>
+    <title>{% block head_title %}{% endblock %}</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+</head>
+<body>
+
+<div id="container">
+    {% block content %}
+    {% endblock %}
+</div>
+
+</body>
+</html>

django_tutorial/urls.py

+from django.conf.urls.defaults import patterns, url, include
+
+from django.contrib import admin
+
+admin.autodiscover()
+
+urlpatterns = patterns('',
+    #(r'^$ ', ),
+    (r'^polls/', include('django_tutorial.apps.polls.urls')),
+    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
+    (r'^admin/', include(admin.site.urls)),
+)

django_tutorial/wsgi/__init__.py

Empty file added.

django_tutorial/wsgi/dev.py

+"""
+WSGI config for django_tutorial project.
+
+This module contains the WSGI application used by Django's development server
+and any production WSGI deployments. It should expose a module-level variable
+named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
+this application via the ``WSGI_APPLICATION`` setting.
+
+Usually you will have the standard Django WSGI application here, but it also
+might make sense to replace the whole Django WSGI application with a custom one
+that later delegates to the Django one. For example, you could introduce WSGI
+middleware here, or combine a Django application with an application of another
+framework.
+
+"""
+import os
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_tutorial.conf.dev.settings")
+
+# This application object is used by any WSGI server configured to use this
+# file. This includes Django's development server, if the WSGI_APPLICATION
+# setting points here.
+from django.core.wsgi import get_wsgi_application
+application = get_wsgi_application()
+
+# Apply WSGI middleware here.
+# from helloworld.wsgi import HelloWorldApplication
+# application = HelloWorldApplication(application)

django_tutorial/wsgi/local.py

+"""
+WSGI config for django_tutorial project.
+
+This module contains the WSGI application used by Django's development server
+and any production WSGI deployments. It should expose a module-level variable
+named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
+this application via the ``WSGI_APPLICATION`` setting.
+
+Usually you will have the standard Django WSGI application here, but it also
+might make sense to replace the whole Django WSGI application with a custom one
+that later delegates to the Django one. For example, you could introduce WSGI
+middleware here, or combine a Django application with an application of another
+framework.
+
+"""
+import os
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_tutorial.conf.local.settings")
+
+# This application object is used by any WSGI server configured to use this
+# file. This includes Django's development server, if the WSGI_APPLICATION
+# setting points here.
+from django.core.wsgi import get_wsgi_application
+application = get_wsgi_application()
+
+# Apply WSGI middleware here.
+# from helloworld.wsgi import HelloWorldApplication
+# application = HelloWorldApplication(application)

django_tutorial/wsgi/test.py

+"""
+WSGI config for django_tutorial project.
+
+This module contains the WSGI application used by Django's development server
+and any production WSGI deployments. It should expose a module-level variable
+named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
+this application via the ``WSGI_APPLICATION`` setting.
+
+Usually you will have the standard Django WSGI application here, but it also
+might make sense to replace the whole Django WSGI application with a custom one
+that later delegates to the Django one. For example, you could introduce WSGI
+middleware here, or combine a Django application with an application of another
+framework.
+
+"""
+import os
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_tutorial.conf.test.settings")
+
+# This application object is used by any WSGI server configured to use this
+# file. This includes Django's development server, if the WSGI_APPLICATION
+# setting points here.
+from django.core.wsgi import get_wsgi_application
+application = get_wsgi_application()
+
+# Apply WSGI middleware here.
+# from helloworld.wsgi import HelloWorldApplication
+# application = HelloWorldApplication(application)
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d _build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html      to make standalone HTML files"
+	@echo "  dirhtml   to make HTML files named index.html in directories"
+	@echo "  pickle    to make pickle files"
+	@echo "  json      to make JSON files"
+	@echo "  htmlhelp  to make HTML files and a HTML help project"
+	@echo "  qthelp    to make HTML files and a qthelp project"
+	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  changes   to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck to check all external links for integrity"
+	@echo "  doctest   to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf _build/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html
+	@echo
+	@echo "Build finished. The HTML pages are in _build/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) _build/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in _build/dirhtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) _build/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) _build/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in _build/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) _build/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in _build/qthelp, like this:"
+	@echo "# qcollectiongenerator _build/qthelp/project.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile _build/qthelp/project.qhc"
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in _build/latex."
+	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
+	      "run these through (pdf)latex."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) _build/changes
+	@echo
+	@echo "The overview file is in _build/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) _build/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in _build/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) _build/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in _build/doctest/output.txt."
+# -*- coding: utf-8 -*-
+#
+# django_tutorial documentation build configuration file, created by
+# sphinx-quickstart on Wed Aug 19 10:27:46 2009.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+import datetime
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.append(os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'django_tutorial'
+copyright = u'%d, myauthor' % datetime.date.today().year
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '1.0'
+# The full version, including alpha/beta/rc tags.
+release = '1.0'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be searched
+# for source files.
+exclude_trees = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'django_tutorialdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'django_tutorial.tex', u'django_tutorial Documentation',
+   u'myauthor', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True

docs/deployment.rst

+Deployment
+==========
+
+Staging/Development
+-------------------
+
+`Fabric <http://pypi.python.org/pypi/Fabric>`_ is used to allow developers to
+easily push changes to a previously setup development/staging environment.
+To get started, install Fabric by running the following command from within
+your virtual environment::
+
+    pip install fabric==1.4
+
+So see a list of available commands, run the following command from within your
+project directory::
+
+    fab -l
+
+Some common commands::
+
+    fab restart       # Restart the web server.
+    fab update        # Just update the repository.
+    fab push deploy   # Push, then fully deploy.
+
+From the within the project directory, you can just run ``fab [command]``.
+If you want to run fabric outside of the directory, use::
+
+	fab --fabfile /path/to/project/fabfile.py [command]
+Welcome to django_tutorial's documentation!
+=====================================
+
+Contents:
+
+.. toctree::
+   :maxdepth: 2
+   
+   install
+   deployment
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
+==================
+Installation
+==================
+
+Pre-Requisites
+===============
+
+* `setuptools <http://pypi.python.org/pypi/setuptools>`_
+* `virtualenv <http://pypi.python.org/pypi/virtualenv>`_
+
+To install all of these system dependencies on a Debian-based system, run::
+
+	sudo apt-get install python-setuptools
+	sudo easy_install virtualenv
+
+
+Creating the Virtual Environment
+================================
+
+First, create a clean base environment using virtualenv::
+
+    virtualenv django_tutorial
+    cd django_tutorial
+    source bin/activate
+
+
+Installing the Project
+======================
+
+Install the requirements and the project source::
+
+	cd path/to/your/django_tutorial/repository
+    pip install -r requirements.pip
+    pip install -e .
+
+
+Configuring a Local Environment
+===============================
+
+If you're just checking the project out locally, you can copy some example
+configuration files to get started quickly::
+
+    cp django_tutorial/conf/local/example/* django_tutorial/conf/local
+    manage.py syncdb --migrate
+
+
+Building Documentation
+======================
+
+Documentation is available in ``docs`` and can be built into a number of 
+formats using `Sphinx <http://pypi.python.org/pypi/Sphinx>`_. To get started::
+
+    pip install Sphinx
+    cd docs
+    make html
+
+This creates the documentation in HTML format at ``docs/_build/html``.
+#!/usr/bin/env python
+import os
+import sys
+
+if __name__ == "__main__":
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE",
+        "django_tutorial.conf.local")
+
+    from django.core.management import execute_from_command_line
+
+    execute_from_command_line(sys.argv)
+# This file collects all required third-party applications that are needed
+# to run this project. Later you can install all these apps in a row
+# using pip. Example::
+#
+#     pip install -r requirements.pip
+
+http://www.djangoproject.com/download/1.4-rc-2/tarball/
+south==0.7.3
+#!/usr/bin/env python
+from setuptools import setup, find_packages
+
+setup(
+    name='django_tutorial',
+    version='1.0',
+    description="",
+    author="Lincoln Loop",
+    author_email='info@lincolnloop.com',
+    url='',
+    packages=find_packages(),
+    package_data={'django_tutorial': ['static/*.*', 'templates/*.*']},
+    scripts=['manage.py'],
+)