Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ran through www fixing a bunch of little things.

  • Loading branch information...
commit f54078189e7c1d1a74cde6c47ce4d97ec2eb7037 1 parent 2e9d9af
Jacob Kaplan-Moss jacobian authored
2  django_website/aggregator/feeds.py
View
@@ -1,6 +1,6 @@
from __future__ import absolute_import
-from django.contrib.syndication.feeds import Feed
+from django.contrib.syndication.views import Feed
from .models import FeedItem
class CommunityAggregatorFeed(Feed):
10 django_website/apps/aggregator/management/commands/update_feeds.py
View
@@ -1,11 +1,12 @@
+import datetime
+import feedparser
+import optparse
import os
+import socket
import sys
import time
-import socket
-import optparse
-import datetime
-import feedparser
from django.core.management.base import BaseCommand
+from django_website.aggregator.models import Feed, FeedItem
class Command(BaseCommand):
"""
@@ -31,7 +32,6 @@ def handle(self, *args, **kwargs):
os.unlink(self.LOCKFILE)
def update_feeds(self, verbose=False):
- from django_website.apps.aggregator.models import Feed, FeedItem
for feed in Feed.objects.filter(is_defunct=False):
if verbose:
print feed
2  django_website/blog/feeds.py
View
@@ -1,7 +1,7 @@
from __future__ import absolute_import
import datetime
-from django.contrib.syndication.feeds import Feed
+from django.contrib.syndication.views import Feed
from .models import Entry
class WeblogEntryFeed(Feed):
2  django_website/contact/urls.py
View
@@ -21,6 +21,6 @@
kwargs = dict(
template = 'contact/sent.html',
),
- name = 'contact_sent',
+ name = 'contact_form_sent',
)
)
3  django_website/legacy/urls.py
View
@@ -8,11 +8,8 @@
from .views import gone
urlpatterns = patterns('',
- (r'^documentation/$', gone),
- (r'^documentation/(?P<version>[\d.]+)/$', gone),
(r'^documentation/models/$', gone),
(r'^documentation/models/(?P<slug>\w+)/$', gone),
(r'^documentation/(?P<version>[\d.]+)/models/$', gone),
(r'^documentation/(?P<version>[\d.]+)/models/(?P<slug>\w+)/$', gone),
- (r'^documentation/(?P<version>[\d.]+)/(?P<slug>[\w\.-]+)/$', gone),
)
12 django_website/settings.py
View
@@ -1,5 +1,7 @@
import os, platform
+BASE = os.path.abspath(os.path.dirname(__file__))
+
# Far too clever trick to know if we're running on the deployment server.
DEVELOPMENT_MODE = (platform.node() != "djangoproject")
@@ -18,9 +20,10 @@
PREPEND_WWW = False
CACHE_BACKEND = "dummy:///"
DJANGO_SVN_ROOT = "http://code.djangoproject.com/svn/django/"
- ADMIN_MEDIA_PREFIX = '/static/'
- MEDIA_ROOT = os.path.join(os.path.dirname(__file__), "media")
+ MEDIA_ROOT = os.path.abspath(os.path.join(BASE, '..', 'media'))
MEDIA_URL = "/media/"
+ ADMIN_MEDIA_PREFIX = '/admin_media/'
+ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
else:
DEBUG = False
PREPEND_WWW = True
@@ -28,9 +31,9 @@
CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
TEMPLATE_DIRS = ['/home/djangoproject.com/django_website/templates']
DJANGO_SVN_ROOT = "file:///home/svn/django/django/"
- ADMIN_MEDIA_PREFIX = 'http://media.djangoproject.com/admin/'
MEDIA_ROOT = "/home/html/djangoproject.com/m/"
- MEDIA_URL = "http://media.djangoproject.com.com/m/"
+ MEDIA_URL = "http://www.djangoproject.com.com/m/"
+ ADMIN_MEDIA_PREFIX = 'http://media.djangoproject.com/admin/'
SITE_ID = 1
ROOT_URLCONF = 'django_website.urls'
@@ -72,6 +75,7 @@
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
)
+
USE_I18N = False
DEFAULT_FROM_EMAIL = "noreply@djangoproject.com"
15 django_website/templates/410.html
View
@@ -0,0 +1,15 @@
+{% extends "base_2col.html" %}
+
+{% block title %}Page removed{% endblock %}
+
+{% block content %}
+
+<h2>Page removed.</h2>
+
+<p>Sorry, we've removed some of parts of the site that were completely out
+of date. In most cases, that content has been moved into
+<a href="http://docs.djangoproject.com/">the new documentation site</a>.</p>
+
+<p>Here's a link to the <a href="/">homepage</a>. You know, just in case.</p>
+
+{% endblock %}
36 django_website/templates/base.html
View
@@ -1,26 +1,22 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <meta http-equiv="Content-Language" content="en-us" />
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Language" content="en-us" />
+ <title>Django | {% block title %}The Web framework for perfectionists with deadlines{% endblock %}</title>
+ <meta name="ROBOTS" content="ALL" />
+ <meta http-equiv="imagetoolbar" content="no" />
+ <meta name="MSSmartTagsPreventParsing" content="true" />
+ <meta name="Copyright" content="Django Software Foundation" />
+ <meta name="keywords" content="Python, Django, framework, open-source" />
+ <meta name="description" content="Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design." />
+ <link href="{{ MEDIA_URL }}css/{% block cssid %}base{% endblock %}.css" rel="stylesheet" type="text/css" media="screen" />
+ <link href="{{ MEDIA_URL }}css/print.css" rel="stylesheet" type="text/css" media="print" />
+ {% block extrahead %}{% endblock %}
+ </head>
- <title>Django | {% block title %}The Web framework for perfectionists with deadlines{% endblock %}</title>
-
- <meta name="ROBOTS" content="ALL" />
- <meta http-equiv="imagetoolbar" content="no" />
- <meta name="MSSmartTagsPreventParsing" content="true" />
- <meta name="Copyright" content="This site's design and contents Copyright (c) 2005 Lawrence Journal-World." />
-
- <meta name="keywords" content="Python, Django, framework, open-source" />
- <meta name="description" content="Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design." />
-
- <link href="{{ MEDIA_URL}}css/{% block cssid %}base{% endblock %}.css" rel="stylesheet" type="text/css" media="screen" />
- <link href="{{ MEDIA_URL }}css/print.css" rel="stylesheet" type="text/css" media="print" />
- {% block extrahead %}{% endblock %}
- </head>
-
- <body id="{% block sectionid %}generic{% endblock %}" class="{% block coltype %}default{% endblock %}">
+ <body id="{% block sectionid %}generic{% endblock %}" class="{% block coltype %}default{% endblock %}">
<div id="container">
<div id="header">
2  django_website/templates/base_code.html
View
@@ -4,4 +4,4 @@
{% block title %}Code{% endblock %}
-{% block billboard %}<h2><a href="http://code.djangoproject.com/"><img src="http://media.djangoproject.com/img/site/bbd_code.gif" alt="Django source code" /></a></h2>{% endblock %}
+{% block billboard %}<h2><a href="http://code.djangoproject.com/"><img src="{{ MEDIA_URL }}img/site/bbd_code.gif" alt="Django source code" /></a></h2>{% endblock %}
126 django_website/templates/docs/0.96_index.html
View
@@ -1,126 +0,0 @@
-{% extends "base_docs.html" %}
-
-{% block content %}
-<h1>Documentation</h1>
-
-<h2 class="deck">
-{% ifequal version "trunk" %}
- These docs are for Django's SVN release, which can be
- significantly different from previous releases. Get old docs here:
- {% for r in all_versions %}
- <a href="{{ r.version }}/">{{ r.version }}</a>{% if forloop.last %}.{% else %},{% endif %}
- {% endfor %}
-{% else %}
- These docs are for Django version {{ version }}. For current documentation,
- <a href="/documentation/">go here</a>.
-{% endifequal %}
-</h2>
-
-<h2>The Django Book</h2>
-
-<p>We're in the process of writing the official Django book. Follow its progress at <a href="http://www.djangobook.com/">djangobook.com</a>. Note that it assumes you're using the Django development version rather than version 0.96.</p>
-
-<h2>The essential documentation</h2>
-
-<p>Make sure to read the following documentation. The rest (in the "Reference" section below) can be read in any particular order, as you need the various functionality.</p>
-
-<ul>
-<li><a href="overview/">Django overview</a></li>
-<li><a href="install/">Installation guide</a></li>
-<li>Tutorial: Writing your first Django app
- <ul>
- <li><a href="tutorial01/">Part 1: Initialization, creating models, the database API</a></li>
- <li><a href="tutorial02/">Part 2: Exploring the automatically-generated admin site</a></li>
- <li><a href="tutorial03/">Part 3: Creating the public interface views</a></li>
- <li><a href="tutorial04/">Part 4: Simple form processing and generic views</a></li>
- </ul>
-</li>
-<li><a href="faq/">Frequently asked questions (FAQ)</a></li>
-<li><a href="documentation/">How to read this documentation</a></li>
-</ul>
-
-<h2 id="reference">Reference</h2>
-
-<ul>
-<li><a href="django-admin/">The django-admin.py and manage.py utilities</a></li>
-<li>Models: <a href="model-api/">Creating models</a> | <a href="models/">Examples</a> | <a href="db-api/">The database API</a> | <a href="transactions/">Transactions</a></li>
-
-<li>Templates: <a href="templates/">Guide for HTML authors</a> | <a href="templates_python/">Guide for Python programmers</a></li>
-
-<li><a href="newforms/">The newforms library</a> | <a href="forms/">The old forms and manipulators library</a></li>
-<li><strong>New:</strong> <a href="testing/">Testing Django applications</a></li>
-<li><a href="sessions/">Sessions</a></li>
-<li><a href="cache/">Caching</a></li>
-<li><a href="i18n/">Internationalization</a></li>
-<li><a href="middleware/">Middleware</a></li>
-<li><a href="settings/">Settings files</a></li>
-<li><a href="url_dispatch/">URL configuration</a></li>
-<li><a href="request_response/">Request and response objects</a></li>
-<li><a href="generic_views/">Generic views</a></li>
-<li><a href="authentication/">Authentication</a></li>
-
-<li><a href="add_ons/">The django.contrib add-ons</a>
- <ul>
- <li><strong>New:</strong> <a href="databrowse/">Databrowse</a></li>
- <li><a href="syndication_feeds/">Syndication feeds (RSS and Atom)</a> (<code>django.contrib.syndication</code>)</li>
- <li><a href="flatpages/">Flatpages</a> (<code>django.contrib.flatpages</code>)</li>
- <li><a href="redirects/">Redirects</a> (<code>django.contrib.redirects</code>)</li>
- <li><a href="sites/">Sites</a> (<code>django.contrib.sites</code>)</li>
- <li><a href="sitemaps/">Sitemaps</a> (<code>django.contrib.sitemaps</code>)</li>
- </ul>
-</li>
-</ul>
-
-<h2>Deployment</h2>
-
-<ul>
-<li><a href="modpython/">Using Django with mod_python</a></li>
-<li><a href="fastcgi/">How to use Django with FastCGI, SCGI or AJP</a></li>
-</ul>
-
-<h2>Solving specific problems</h2>
-
-<ul>
-<li><a href="apache_auth/">Authenticating against Django's user database from Apache</a></li>
-<li><a href="static_files/">Serving static/media files</a></li>
-<li><a href="email/">Sending e-mail</a></li>
-<li><a href="legacy_databases/">Integrating with (introspecting) a legacy database</a></li>
-<li><a href="outputting_pdf/">Outputting PDFs dynamically</a></li>
-<li><a href="outputting_csv/">Outputting CSV dynamically</a></li>
-</ul>
-
-<h2>Et cetera</h2>
-<ul>
-<li><a href="design_philosophies/">Design philosophies</a></li>
-<li><a href="contributing/">How to contribute to Django</a></li>
-<li><a href="admin_css/">Django admin CSS guide</a></li>
-<li><a href="api_stability/">API stability</a></li>
-<li><a href="http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges">Backwards-incompatible changes</a></li>
-</ul>
-
-<h2>Release notes</h2>
-<ul>
-<li><a href="release_notes_0.96/">Version 0.96</a></li>
-<li><a href="release_notes_0.95/">Version 0.95</a></li>
-</ul>
-{% endblock %}
-
-{% block content-related %}
-
-<h2>Search docs via Google</h2>
-<form action="http://www.google.com/search" method="get">
-<p><input type="text" name="as_q" /> <input type="submit" value="Go" /></p>
-<input type="hidden" name="as_sitesearch" value="www.djangoproject.com" />
-</form>
-
-<h2>Getting help</h2>
-<ul class="toc">
- <li><a href="irc://irc.freenode.net/django">#django IRC channel</a></li>
- <li><a href="http://simon.bofh.ms/logger/django/">#django IRC logs</a></li>
- <li><a href="http://groups-beta.google.com/group/django-users">Django-users mailing list</a></li>
- <li><a href="http://groups-beta.google.com/group/django-developers">Django-developers mailing list</a></li>
- <li><a href="http://code.djangoproject.com/simpleticket">Report a bug</a></li>
- <li><a href="/comments/">Recent comments posted to djangoproject.com</a></li>
-</ul>
-
-{% endblock %}
44 django_website/templates/docs/detail.html
View
@@ -1,44 +0,0 @@
-{% extends "base_docs.html" %}
-
-{% block title %}{{ doc.title }} | Django Documentation{% endblock %}
-
-{% block content %}
-<h1>{{ doc.title }}</h1>
-
-<h2 class="deck">
-{% ifequal version "trunk" %}
- This document is for Django's SVN release, which can be
- significantly different from previous releases. Get old docs here:
- {% for r in all_versions %}
- <a href="../{{ r.version }}/{{ slug }}/">{{ r.version }}</a>{% if forloop.last %}.{% else %},{% endif %}
- {% endfor %}
-{% else %}
- This document describes Django version {{ version }}. For current documentation,
- <a href="/documentation/{{ slug }}/">go here</a>.
-{% endifequal %}
-</h2>
-
-{{ doc.body|safe }}
-
-<div id="content-secondary">
- <h2 id="comments">Questions/Feedback</h2>
- <p>
- If you notice errors with this documentation, please <a
- href="http://code.djangoproject.com/simpleticket?component=Documentation">
- open a ticket</a> and let us know!
- </p>
- <p>
- Please only use the ticket tracker for criticisms and improvements on the
- docs. For tech support, ask in the IRC channel or post to the <a
- href="http://groups-beta.google.com/group/django-users"> django-users
- list</a>.
- </p>
-</div>
-{% endblock %}
-
-{% block content-related %}
- <h2>Contents</h2>
- {{ doc.toc|safe }}
- <h3>Last update:</h3>
- <div>{{ update_date|date:"F j, Y, P" }} (<a href="http://www.timeanddate.com/worldclock/city.html?n=64">CDT</a>)</div>
-{% endblock %}
138 django_website/templates/docs/index.html
View
@@ -1,138 +0,0 @@
-{% extends "base_docs.html" %}
-
-{% block content %}
-<h1>Documentation</h1>
-
-<h2 class="deck">
-{% ifequal version "trunk" %}
- These docs are for Django's SVN release, which can be
- significantly different from previous releases. Get old docs here:
- {% for r in all_versions %}
- <a href="{{ r.version }}/">{{ r.version }}</a>{% if forloop.last %}.{% else %},{% endif %}
- {% endfor %}
-{% else %}
- These docs are for Django version {{ version }}. For current documentation,
- <a href="/documentation/">go here</a>.
-{% endifequal %}
-</h2>
-
-<h2>The Django Book</h2>
-
-<p>You can read the entire Django Book for free at <a href="http://www.djangobook.com/">djangobook.com</a> or buy a print version in finer bookstores. We recommend reading the first few chapters as your first introduction to Django.</p>
-
-<h2>The essential documentation</h2>
-
-<p>Make sure to read the following documentation. The rest (in the "Reference" section below) can be read in any particular order, as you need the various functionality.</p>
-
-<ul>
-<li><a href="overview/">Django overview</a></li>
-<li><a href="install/">Installation guide</a></li>
-<li>Tutorial: Writing your first Django app
- <ul>
- <li><a href="tutorial01/">Part 1: Initialization, creating models, the database API</a></li>
- <li><a href="tutorial02/">Part 2: Exploring the automatically-generated admin site</a></li>
- <li><a href="tutorial03/">Part 3: Creating the public interface views</a></li>
- <li><a href="tutorial04/">Part 4: Simple form processing and generic views</a></li>
- </ul>
-</li>
-<li><a href="faq/">Frequently asked questions (FAQ)</a></li>
-<li><a href="documentation/">How to read this documentation</a></li>
-</ul>
-
-<h2 id="reference">Reference</h2>
-
-<ul>
-<li><a href="django-admin/">The django-admin.py and manage.py utilities</a></li>
-<li>Models: <a href="model-api/">Creating models</a> | <a href="models/">Examples</a> | <a href="db-api/">The database API</a> | <a href="transactions/">Transactions</a></li>
-
-<li>Templates: <a href="templates/">Guide for HTML authors</a> | <a href="templates_python/">Guide for Python programmers</a></li>
-
-<li><a href="forms/">Forms</a></li>
-<li><strong>New:</strong> Files: <a href="files/">file handling</a> | <a href="upload_handling/">file uploads</a></li>
-<li><a href="testing/">Testing Django applications</a></li>
-<li><a href="sessions/">Sessions</a></li>
-<li><a href="cache/">Caching</a></li>
-<li><a href="i18n/">Internationalization</a></li>
-<li><a href="middleware/">Middleware</a></li>
-<li><a href="settings/">Settings files</a></li>
-<li><a href="url_dispatch/">URL configuration</a></li>
-<li><a href="request_response/">Request and response objects</a></li>
-<li><a href="generic_views/">Generic views</a></li>
-<li><a href="authentication/">Authentication</a></li>
-<li><a href="shortcuts/">Shortcut functions</a></li>
-<li><strong>New:</strong> <a href="unicode/">Unicode data in Django</a></li>
-<li><strong>New:</strong> <a href="pagination/">Pagination</a></li>
-<li><strong>New:</strong> <a href="serialization/">Serialization</a></li>
-
-<li><a href="add_ons/">The django.contrib add-ons</a>
- <ul>
- <li><a href="admin/">The automatic admin interface</a> (<code>django.contrib.admin</code>)</li>
- <li><a href="contenttypes/">Contenttypes Framework</a> (<code>django.contrib.contenttypes</code>)</li>
- <li><a href="csrf/">Cross Site Request Forgery protection</a> (<code>django.contrib.csrf</code>)</li>
- <li><a href="databrowse/">Databrowse</a> (<code>django.contrib.databrowse</code>)</li>
- <li><a href="flatpages/">Flatpages</a> (<code>django.contrib.flatpages</code>)</li>
- <li><strong>New:</strong> <a href="form_preview/">Form preview</a> (<code>django.contrib.formtools</code>)</li>
- <li><strong>New:</strong> <a href="form_wizard/">Form wizard</a> (<code>django.contrib.formtools.wizard</code>)</li>
- <li><a href="redirects/">Redirects</a> (<code>django.contrib.redirects</code>)</li>
- <li><a href="sites/">Sites</a> (<code>django.contrib.sites</code>)</li>
- <li><a href="sitemaps/">Sitemaps</a> (<code>django.contrib.sitemaps</code>)</li>
- <li><a href="syndication_feeds/">Syndication feeds (RSS and Atom)</a> (<code>django.contrib.syndication</code>)</li>
- <li><strong>New:</strong> <a href="webdesign/">Web design helpers</a> (<code>django.contrib.webdesign</code>)</li>
- </ul>
-</li>
-</ul>
-
-<h2>Deployment</h2>
-
-<ul>
-<li><a href="modpython/">Using Django with mod_python</a></li>
-<li><a href="fastcgi/">How to use Django with FastCGI, SCGI or AJP</a></li>
-</ul>
-
-<h2>Solving specific problems</h2>
-
-<ul>
-<li><a href="apache_auth/">Authenticating against Django's user database from Apache</a></li>
-<li><a href="static_files/">Serving static/media files</a></li>
-<li><a href="email/">Sending e-mail</a></li>
-<li><a href="legacy_databases/">Integrating with (introspecting) a legacy database</a></li>
-<li><a href="outputting_pdf/">Outputting PDFs dynamically</a></li>
-<li><a href="outputting_csv/">Outputting CSV dynamically</a></li>
-</ul>
-
-<h2>Et cetera</h2>
-<ul>
-<li><a href="design_philosophies/">Design philosophies</a></li>
-<li><a href="contributing/">How to contribute to Django</a></li>
-<li><a href="admin_css/">Django admin CSS guide</a></li>
-<li><a href="api_stability/">API stability</a></li>
-<li><a href="http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges">Backwards-incompatible changes</a></li>
-</ul>
-
-<h2>Release notes</h2>
-<ul>
-<li><a href="release_notes_1.0_alpha/">Version 1.0 Alpha</a></li>
-<li><a href="release_notes_0.96/">Version 0.96</a></li>
-<li><a href="release_notes_0.95/">Version 0.95</a></li>
-</ul>
-{% endblock %}
-
-{% block content-related %}
-
-<h2>Search docs via Google</h2>
-<form action="http://www.google.com/search" method="get">
-<p><input type="text" name="as_q" /> <input type="submit" value="Go" /></p>
-<input type="hidden" name="as_sitesearch" value="www.djangoproject.com" />
-</form>
-
-<h2>Getting help</h2>
-<ul class="toc">
- <li><a href="irc://irc.freenode.net/django">#django IRC channel</a></li>
- <li><a href="http://oebfare.com/logger/django/">#django IRC logs</a></li>
- <li><a href="http://groups-beta.google.com/group/django-users">Django-users mailing list</a></li>
- <li><a href="http://groups-beta.google.com/group/django-developers">Django-developers mailing list</a></li>
- <li><a href="http://code.djangoproject.com/simpleticket">Report a bug</a></li>
- <li><a href="/comments/">Recent comments posted to djangoproject.com</a></li>
-</ul>
-
-{% endblock %}
44 django_website/templates/docs/model_detail.html
View
@@ -1,44 +0,0 @@
-{% extends "base_docs.html" %}
-
-{% block title %}{{ doc.title }} | Django Documentation{% endblock %}
-
-{% block content %}
-<h1>{{ doc.title }}</h1>
-
-<h2 class="deck">
-{% ifequal version "trunk" %}
- This example is for Django's SVN release, which can be
- significantly different from previous releases. Get old examples here:
- {% for r in all_versions %}
- <a href="/documentation/{{ r.version }}/models/{{ slug }}/">{{ r.version }}</a>{% if forloop.last %}.{% else %},{% endif %}
- {% endfor %}
-{% else %}
- This example describes Django version {{ version }}. For the current example,
- <a href="/documentation/models/{{ slug }}/">go here</a>.
-{% endifequal %}
-</h2>
-
-{{ doc.fragment|safe }}
-
-<h2 id="model-source-code">Model source code</h2>
-<pre class="literal-block">{{ doc.model_source|escape }}</pre>
-
-{% if doc.api_usage %}
-<h2 id="sample-usage">Sample API usage</h2>
-<p>This sample code assumes the above model{{ doc.models|pluralize }} {% if doc.models|pluralize %}have{% else %}has{% endif %}
-been saved in a file <tt class="docutils literal"><span class="pre">mysite/models.py</span></tt>.
-<pre class="literal-block">&gt;&gt;&gt; from mysite.models import {% for model in doc.models %}{{ model }}{% if not forloop.last %}, {% endif %}{% endfor %}
-{{ doc.api_usage|escape }}</pre>
-{% endif %}
-
-{% endblock %}
-
-{% block content-related %}
- <h2>Contents</h2>
- <ul>
- <li><a href="#model-source-code">Model source code</a></li>
- {% if doc.api_usage %}
- <li><a href="#sample-usage">Sample API usage</a></li>
- {% endif %}
- </ul>
-{% endblock %}
26 django_website/templates/docs/model_index.html
View
@@ -1,26 +0,0 @@
-{% extends "base_docs.html" %}
-
-{% block content %}
- <h1>Model examples</h1>
-
- <h2 class="deck">
- {% ifequal version "trunk" %}
- These examples are from Django's SVN release, which can be
- significantly different from previous releases. Get old examples here:
- {% for r in all_versions %}
- <a href="../{{ r.version }}/models/">{{ r.version }}</a>{% if forloop.last %}.{% else %},{% endif %}
- {% endfor %}
- {% else %}
- These examples are from Django version {{ version }}. For current documentation,
- <a href="/documentation/models/">go here</a>.
- {% endifequal %}
- </h2>
-
- <p>This is a set of example models.</p>
-
- <ol>
- {% for ex in example_list %}
- <li><a href="{{ ex.link }}/">{{ ex.title }}</a></li>
- {% endfor %}
- </ol>
-{% endblock %}
2  django_website/templates/registration/login.html
View
@@ -10,7 +10,7 @@
<p class="error">Please correct the errors below:</p>
{% endif %}
-<form method="post" action="?next={{ next|default:"/" }}">
+<form method="post" action="?next={{ next|default:"/" }}">{% csrf_token %}
<dl>
<dt><label for="id_username">Username:</label>{% if form.username.errors %} <span class="error">{{ form.username.errors|join:", " }}</span>{% endif %}</dt>
<dd>{{ form.username }}</dd>
28 django_website/views.py
View
@@ -0,0 +1,28 @@
+"""
+Misc. views.
+"""
+from __future__ import absolute_import
+
+from django.contrib.comments.models import Comment
+from django.contrib.sitemaps import views as sitemap_views
+from django.views.decorators.cache import cache_page
+from django.views.generic import list_detail
+from django.views.generic.simple import direct_to_template
+from .sitemaps import FlatPageSitemap, WeblogSitemap
+
+def homepage(request):
+ return direct_to_template(request, 'homepage.html')
+
+@cache_page(60*60*6)
+def sitemap(request):
+ return sitemap_views.sitemap(request, sitemaps={
+ 'weblog': WeblogSitemap,
+ 'flatpages': FlatPageSitemap,
+ })
+
+def comments(request):
+ return list_detail.object_list(
+ request,
+ queryset = Comment.objects.filter(is_public=True).order_by('-submit_date'),
+ paginate_by = 30,
+ )
3  requirements.txt
View
@@ -2,4 +2,5 @@ Django >= 1.2, < 1.3
django-registration == 0.7
akismet == 0.2.0
FeedParser >= 4.1, < 5.0
-psycopg2 >= 2.2, < 2.3
+psycopg2 >= 2.2, < 2.3
+-e hg+http://bitbucket.org/ubernostrum/django-contact-form#egg=django_contact_form
Please sign in to comment.
Something went wrong with that request. Please try again.