Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Ran through www fixing a bunch of little things.

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

0 notes on commit f540781

Please sign in to comment.
Something went wrong with that request. Please try again.