Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Large community import from other git repo.

  • Loading branch information...
commit 84dd29a5326d099d99dbc0aa8e06eeefaffc8a93 1 parent 2c368f7
Justin Abrahms justinabrahms authored
Showing with 552 additions and 33 deletions.
  1. +6 −2 django_website/apps/aggregator/admin.py
  2. +13 −0 django_website/apps/aggregator/forms.py
  3. 0  django_website/apps/aggregator/management/__init__.py
  4. 0  django_website/apps/aggregator/management/commands/__init__.py
  5. +19 −0 django_website/apps/aggregator/management/commands/mark_defunct_feeds.py
  6. +72 −0 django_website/apps/aggregator/management/commands/update_feeds.py
  7. +12 −0 django_website/apps/aggregator/models.py
  8. +40 −0 django_website/apps/aggregator/views.py
  9. +229 −0 django_website/media/css/base.css
  10. +4 −0 django_website/media/css/homepage.css
  11. +22 −0 django_website/media/css/print.css
  12. BIN  django_website/media/img/doc/icons/docicons-behindscenes.gif
  13. BIN  django_website/media/img/doc/icons/docicons-note.gif
  14. BIN  django_website/media/img/doc/icons/docicons-philosophy.gif
  15. BIN  django_website/media/img/site/bbd_blogroll.gif
  16. BIN  django_website/media/img/site/bbd_code.gif
  17. BIN  django_website/media/img/site/bbd_community.gif
  18. BIN  django_website/media/img/site/bbd_documentation.gif
  19. BIN  django_website/media/img/site/bbd_download.gif
  20. BIN  django_website/media/img/site/bbd_homepage.gif
  21. BIN  django_website/media/img/site/bbd_overview.gif
  22. BIN  django_website/media/img/site/bbd_weblog.gif
  23. BIN  django_website/media/img/site/bbdsm_bg.gif
  24. BIN  django_website/media/img/site/bbdsm_bg.gif.1
  25. BIN  django_website/media/img/site/hdr_logo.gif
  26. BIN  django_website/media/img/site/mt.png
  27. BIN  django_website/media/img/site/nav_bg.gif
  28. +9 −6 django_website/settings.py
  29. +16 −0 django_website/templates/aggregator/add_feed.html
  30. +1 −2  django_website/templates/aggregator/feeditem_list.html
  31. +14 −0 django_website/templates/aggregator/feedtype_list.html
  32. +63 −0 django_website/templates/aggregator/index.html
  33. +4 −4 django_website/templates/base.html
  34. +1 −14 django_website/templates/base_community.html
  35. +1 −1  django_website/templates/homepage.html
  36. +2 −0  django_website/upgrade/add_community.sql
  37. +24 −4 django_website/urls.py
8 django_website/apps/aggregator/admin.py
View
@@ -1,5 +1,5 @@
from django.contrib import admin
-from django_website.apps.aggregator.models import Feed, FeedItem
+from django_website.apps.aggregator.models import Feed, FeedItem, FeedType
admin.site.register(Feed,
list_display = ["title", "public_url", "is_defunct"],
@@ -14,4 +14,8 @@
list_filter = ['feed'],
search_fields = ['feed__title', 'feed__public_url', 'title'],
date_heirarchy = ['date_modified'],
-)
+)
+
+admin.site.register(FeedType,
+ prepopulated_fields = {'slug': ('name',)},
+)
13 django_website/apps/aggregator/forms.py
View
@@ -0,0 +1,13 @@
+from django import forms
+from django.forms import widgets
+from apps.aggregator.models import Feed, FeedType
+
+class FeedModelForm(forms.ModelForm):
+ title = forms.CharField(max_length=250, help_text="The name of the resource / blog.")
+ feed_url = forms.URLField(help_text="URL to the feed.")
+ public_url = forms.URLField(help_text="URL to main page of the resource (ie: blog homepage)")
+ feed_type = forms.ModelChoiceField(widget=forms.widgets.HiddenInput,
+ queryset=FeedType.objects.all())
+ class Meta:
+ model = Feed
+ exclude = ('is_defunct',)
0  django_website/apps/aggregator/management/__init__.py
View
No changes.
0  django_website/apps/aggregator/management/commands/__init__.py
View
No changes.
19 django_website/apps/aggregator/management/commands/mark_defunct_feeds.py
View
@@ -0,0 +1,19 @@
+import urllib2
+from django.core.management.base import BaseCommand
+from django_website.apps.aggregator.models import Feed
+
+class Command(BaseCommand):
+ """
+ Mark people with 404'ing feeds as defunct.
+ """
+ def handle(self, *args, **kwargs):
+ for f in Feed.objects.all():
+ try:
+ r = urllib2.urlopen(f.feed_url)
+ except urllib2.HTTPError, e:
+ if e.code == 404 or e.code == 500:
+ print "%s on %s; marking defunct" % (e.code, f)
+ f.is_defunct = True
+ f.save()
+ else:
+ raise
72 django_website/apps/aggregator/management/commands/update_feeds.py
View
@@ -0,0 +1,72 @@
+import os
+import sys
+import time
+import socket
+import optparse
+import datetime
+import feedparser
+from django.core.management.base import BaseCommand
+
+class Command(BaseCommand):
+ """
+ Update feeds for Django community page. Requires Mark Pilgrim's excellent
+ Universal Feed Parser (http://feedparser.org)
+ """
+ LOCKFILE = "/tmp/update_feeds.lock"
+
+ def handle(self, *args, **kwargs):
+ try:
+ lockfile = os.open(self.LOCKFILE, os.O_CREAT | os.O_EXCL)
+ except OSError:
+ sys.exit(1)
+
+ try:
+ verbose = kwargs.get('verbose')
+ socket.setdefaulttimeout(15)
+ self.update_feeds(verbose=verbose)
+ except:
+ sys.exit(1)
+ finally:
+ os.close(lockfile)
+ 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
+ parsed_feed = feedparser.parse(feed.feed_url)
+ for entry in parsed_feed.entries:
+ title = entry.title.encode(parsed_feed.encoding, "xmlcharrefreplace")
+ guid = entry.get("id", entry.link).encode(parsed_feed.encoding, "xmlcharrefreplace")
+ link = entry.link.encode(parsed_feed.encoding, "xmlcharrefreplace")
+
+ if not guid:
+ guid = link
+
+ if hasattr(entry, "summary"):
+ content = entry.summary
+ elif hasattr(entry, "content"):
+ content = entry.content[0].value
+ elif hasattr(entry, "description"):
+ content = entry.description
+ else:
+ content = u""
+ content = content.encode(parsed_feed.encoding, "xmlcharrefreplace")
+
+ try:
+ if entry.has_key('modified_parsed'):
+ date_modified = datetime.datetime.fromtimestamp(time.mktime(entry.modified_parsed))
+ elif parsed_feed.feed.has_key('modified_parsed'):
+ date_modified = datetime.datetime.fromtimestamp(time.mktime(parsed_feed.feed.modified_parsed))
+ elif parsed_feed.has_key('modified'):
+ date_modified = datetime.datetime.fromtimestamp(time.mktime(parsed_feed.modified))
+ else:
+ date_modified = datetime.datetime.now()
+ except TypeError:
+ date_modified = datetime.datetime.now()
+
+ try:
+ feed.feeditem_set.get(guid=guid)
+ except FeedItem.DoesNotExist:
+ feed.feeditem_set.create(title=title, link=link, summary=content, guid=guid, date_modified=date_modified)
12 django_website/apps/aggregator/models.py
View
@@ -1,10 +1,22 @@
from django.db import models
+class FeedType(models.Model):
+ name = models.CharField(max_length=250)
+ slug = models.SlugField(max_length=250)
+ can_self_add = models.BooleanField(default=True)
+
+ def __unicode__(self):
+ return "%s" % (self.name,)
+
+ def items(self):
+ return FeedItem.objects.filter(feed__feed_type=self)
+
class Feed(models.Model):
title = models.CharField(max_length=500)
feed_url = models.URLField(unique=True, max_length=500)
public_url = models.URLField(max_length=500)
is_defunct = models.BooleanField()
+ feed_type = models.ForeignKey(FeedType)
class Meta:
db_table = 'aggregator_feeds'
40 django_website/apps/aggregator/views.py
View
@@ -0,0 +1,40 @@
+from django.shortcuts import render_to_response, get_object_or_404
+from django.template import RequestContext
+from django.contrib.auth.decorators import login_required
+from django.http import HttpResponseRedirect
+from django.core.urlresolvers import reverse
+from django.views.generic.list_detail import object_list
+from apps.aggregator.models import FeedItem, Feed, FeedType
+from apps.aggregator.forms import FeedModelForm
+
+def index(request):
+ feedtype_list = FeedType.objects.all()
+ return render_to_response('aggregator/index.html',
+ {'feedtype_list': feedtype_list},
+ context_instance=RequestContext(request))
+
+def feed_list(request, feed_type_slug):
+ feed_type = get_object_or_404(FeedType, slug=feed_type_slug)
+ items = FeedItem.objects.filter(feed__feed_type=feed_type)
+ return object_list(request, items)
+
+def feed_type_list(request):
+ return object_list(request, FeedType.objects.all())
+
+@login_required
+def add_feed(request, feed_type_slug):
+ ft = get_object_or_404(FeedType, slug=feed_type_slug, can_self_add=True)
+ initial_data = {'feed_type': ft.id}
+ f = FeedModelForm(request.POST or None, initial=initial_data)
+ if f.is_valid():
+ if f.save():
+ return HttpResponseRedirect(reverse('community-index'))
+ else:
+ # not sure when this happens.
+ return render_to_response('aggregator/add_feed.html',
+ {'form':f},
+ context_instance=RequestContext(request))
+ else:
+ return render_to_response('aggregator/add_feed.html',
+ {'form':f},
+ context_instance=RequestContext(request))
229 django_website/media/css/base.css
View
@@ -0,0 +1,229 @@
+/*
+djangoproject.com by Wilson Miner (wilson@lawrence.com)
+Copyright (c) 2005 Lawrence Journal-World. Please don't steal.
+*/
+
+
+/* SETUP */
+
+body { margin:0; padding:0; background:#092e20; color:white; }
+body, th, td { font:12px/1.4em Verdana,sans-serif; }
+#container { position:relative; min-width:55em; max-width:100em; }
+#homepage #container { max-width:100em; }
+
+/* LINKS */
+
+a {text-decoration: none;}
+a img {border: none;}
+a:link, a:visited { color:#ffc757; }
+#content-main a:link, #content-main a:visited { color:#ab5603; text-decoration:underline; }
+#content-secondary a:link, #content-secondary a:visited { color:#ffc757; text-decoration:none; }
+a:hover { color:#ffe761; }
+#content-main a:hover { background-color:#E0FFB8; color:#234f32; text-decoration:none; }
+#content-secondary a:hover { color:#ffe761; background:none; }
+#content-main h2 a, #content-main h3 a { text-decoration:none !important; }
+
+/* HEADER */
+
+#header { position:relative; height:6.5em; background:#092e20; }
+#header h1#logo { margin:0; width:111px; height:41px; position:absolute; bottom:10px; left:25px; }
+
+/* NAV */
+
+#nav-global { position:absolute; margin:0; bottom:0; right:0; font-family:"Trebuchet MS",sans-serif; white-space:nowrap; }
+#nav-global li { display:block; float:left; list-style-type:none; margin:0; padding:0; }
+#nav-global a { display:block; float:left; padding:5em 16px 10px 16px; background:#092e20; }
+#nav-global a:hover { color:white; background:#234f32; }
+#homepage #nav-homepage a, #overview #nav-overview a, #download #nav-download a, #documentation #nav-documentation a, #weblog #nav-weblog a, #community #nav-community a, #blogroll #nav-blogroll a, #code #nav-code a { color:white; background:#092e20 url(../img/site/nav_bg.gif) bottom repeat-x; }
+
+/* COLUMNS */
+
+#columnwrap { background:#234f32; padding-bottom:10px; }
+#subwrap { background:#326342; width:73%; float:left; padding-bottom:10px; }
+#content-main { float:left; width:70%; background:white; color:black; padding-bottom:10px; }
+#generic #content-main, #code #content-main { width:100%; }
+#content-main * { margin-left:22px; margin-right:24px; }
+#content-main * * { margin-left:0; margin-right:0; }
+.sidebar { font-size:92%; }
+.sidebar * { margin-left:14px; margin-right:14px; }
+.sidebar * * { margin-left:0; margin-right:0; }
+#content-extra { float:right; width:27%; }
+#content-related { float:right; width:30%;}
+#content-secondary { clear:both; background:#487858; margin-left:0; margin-right:0; margin-top:15px; margin-bottom:-10px; padding:10px 24px; color:white; }
+.subcol-primary, .subcol-secondary { width:40%; float:left; padding-bottom:1.2em; }
+.subcol-primary { margin-right:1%; }
+
+/* CONTENT */
+
+h1,h2,h3 { margin-top:.8em; font-family:"Trebuchet MS",sans-serif; font-weight:normal; }
+h1 { font-size:218%; margin-top:.6em; margin-bottom:.6em; color:#092e20; line-height:1.1em; }
+h2 { font-size:150%; margin-top:1em; margin-bottom:.2em; line-height:1.2em; color:#092e20; }
+#homepage h2 { font-size:140%; }
+h3 { font-size:125%; font-weight:bold; margin-bottom:.2em; color:#487858; }
+h4 { font-size:100%; font-weight:bold; margin-bottom:-3px; margin-top:1.2em; text-transform:uppercase; letter-spacing:1px; }
+h4 pre, h4 tt, h4 .literal { text-transform:none; }
+h5 { font-size:1em; font-weight:bold; margin-top:1.5em; margin-bottom:3px; }
+p, ul, dl { margin-top:.6em; margin-bottom:.8em; }
+hr { color:#ccc; background-color:#ccc; height:1px; border:0; }
+p.date { color:#487858; margin-top:-.2em; }
+p.more { margin-top:-.4em; }
+.sidebar p.date { color:#90ba9e; }
+#content-secondary h2, .sidebar h2 { color:white; }
+#content-secondary h3, .sidebar h3 { color:#9aef3f; }
+#content-secondary h2:first-child { margin-top:.6em; }
+.sidebar h2:first-child { margin-top:.8em; }
+#content-main h2, #content-main h3 { margin-top:1.2em; }
+h2.deck { margin-bottom:.6em; color:#487858; }
+ins { text-decoration: none; }
+ins a { text-decoration: none; }
+
+/* COMMUNITY */
+
+body#community h5 { margin-top: 5px; }
+body#community #content-main .module { width: 350px; float: left; display: inline;}
+body#community #content-main .first { margin-left: 20px; }
+body#community #content-main .last { margin-right: 5px; }
+body#community #add_feed_form label { display: block; width: 75px; float: left; }
+body#community .hidden { display: none; }
+
+/* LISTS */
+
+ul { padding-left:2em; }
+ol { padding-left:30px; }
+ul li { list-style-type:square; margin-bottom:.4em; }
+ul ul { padding-left:1.2em; }
+ul ul ul { padding-left:1em; }
+ul.linklist, ul.toc { padding-left:0; }
+ul.toc ul { margin-left:.6em; }
+ul.toc ul li { list-style-type:square; }
+ul.toc ul ul li { list-style-type:disc; }
+ul.linklist li, ul.toc li { list-style-type:none; }
+dt { font-weight:bold; margin-top:.5em; font-size:1.1em; }
+dd { margin-bottom:.8em; }
+dl.index dt { font-weight: normal; }
+
+/* RSS */
+
+a.rss { font:bold 10px Verdana, sans-serif; padding:0 .2em; border: 1px solid; text-decoration:none; background:#f60;color: #fff; border-color:#ffc8a4 #7d3302 #3f1a01 #ff9a57; margin:0 3px; vertical-align:middle; }
+#content-main a.rss { color:#fff; text-decoration:none; }
+a.rss:hover, a.rss:link, a.rss:visited { color:#fff; text-decoration:none; }
+
+/* BLOCKQUOTES */
+
+#weblog blockquote { padding-left:0.8em; padding-right:1em; font:125%/1.2em "Trebuchet MS", sans-serif; color:#234f32; border-left:2px solid #94da3a; }
+.sidebar blockquote { margin-top:1.5em; margin-bottom:1.5em; }
+.sidebar blockquote p { font:italic 175%/1.2em "Trebuchet MS",sans-serif; color:#94da3a; }
+.sidebar blockquote cite { display:block; font-style:normal; line-height:1.2em; margin-top:-.8em; color:#94da3a; }
+.sidebar cite strong { font-weight:normal; color:white; }
+
+/* CODE BLOCKS */
+
+.literal { white-space:nowrap; }
+.literal, .literal-block { color:#234f32; }
+.sidebar .literal { color:white; background:transparent; font-size:11px; }
+pre, .literal-block { font-size:medium; background:#E0FFB8; border:1px solid #94da3a; border-width:1px 0; margin: 1em 0; padding: .3em .4em; overflow: auto; }
+dt .literal, table .literal { background:none; }
+textarea.codedump { font-size:10px; color:#234f32; width:100%; background:#E0FFB8; border:1px solid #94da3a; border-width:1px 0; padding: .3em .4em; }
+
+/* NOTES & ADMONITIONS */
+
+.note, .admonition, .caution { padding:.8em 1em .8em; margin: 1em 0; border:1px solid #94da3a; }
+.admonition-title { font-weight:bold; margin-top:0 !important; margin-bottom:0 !important;}
+.admonition .last { margin-bottom:0 !important; }
+.admonition, .admonition-note, .caution { padding-left:65px; background:url(../img/doc/icons/docicons-note.gif) .8em .8em no-repeat;}
+div.admonition-philosophy { padding-left:65px; background:url(../img/doc/icons/docicons-philosophy.gif) .8em .8em no-repeat;}
+div.admonition-behind-the-scenes { padding-left:65px; background:url(../img/doc/icons/docicons-behindscenes.gif) .8em .8em no-repeat;}
+
+/* DOCS */
+
+#documentation h2, #documentation h3, #documentation h4 { margin-top:1.4em; }
+#documentation dd { margin-left:1em; }
+#content-main table { color:#000; }
+table.docutils { border-collapse:collapse; }
+table.docutils thead th { border-bottom:2px solid #dfdfdf; text-align:left; }
+table.docutils td, table.docutils th { border-bottom:1px solid #dfdfdf; padding:4px 2px;}
+table.docutils td p { margin-top:0; margin-bottom:.5em; }
+#documentation #content-related .literal { background:transparent !important; }
+div.versionadded span.title, div.versionchanged span.title { font-weight: bold; }
+
+/* Sphinx-specific fixes */
+#documentation a.headerlink { color: #c60f0f; font-size: 0.8em; padding: 0 4px 0 4px; text-decoration: none; visibility: hidden; }
+#documentation *:hover > a.headerlink { visibility: visible; }
+#documentation a.reference { text-decoration: none; }
+#documentation a.reference tt.literal { border-bottom: 1px #234f32 dotted; }
+#documentation a.reference em { font-style: normal; }
+
+/* BILLBOARDS */
+
+#billboard { background:#94da3a url(../img/site/bbdsm_bg.gif) repeat-x; border-bottom:6px solid #092e20; }
+#billboard h2 { margin:0; }
+#generic #billboard { display:none; }
+#homepage #billboard { background-image: url(../img/site/bbd_bg.gif); }
+#homepage #billboard h2 { margin:0; text-indent:-5000px; height:80px; width:633px; background:url(../img/site/bbd_homepage.gif) no-repeat; }
+#overview #billboard h2 { margin:0; text-indent:-5000px; height:60px; width:203px; background:url(../img/site/bbd_overview.gif) no-repeat; }
+#download #billboard h2 { margin:0; text-indent:-5000px; height:60px; width:203px; background:url(../img/site/bbd_download.gif) no-repeat; }
+#documentation #billboard h2 a { display:block; margin:0; text-indent:-5000px; height:60px; width:226px; background:url(../img/site/bbd_documentation.gif) no-repeat; }
+#weblog #billboard h2 a { display:block; margin:0; text-indent:-5000px; height:60px; width:226px; background:url(../img/site/bbd_weblog.gif) no-repeat; }
+#community #billboard h2 { display:block; margin:0; text-indent:-5000px; height:60px; width:226px; background:url(../img/site/bbd_community.gif) no-repeat; }
+#blogroll #billboard h2 { display:block; margin:0; text-indent:-5000px; height:60px; width:168px; background:url(../img/site/bbd_blogroll.gif) no-repeat; }
+#code #billboard h2 a { display:block; margin:0; text-indent:-5000px; height:60px; width:184px; background:url(../img/site/bbd_code.gif) no-repeat; }
+
+/* FOOTER */
+
+#footer { clear:both; color:#487858; padding:10px 20px; font-size:90%; }
+
+/* COMMENTS */
+
+.comment { margin:15px 0; }
+div.comment p { margin-left:1em; }
+#weblog div.comment p.date { margin-bottom:.2em; color:#94da3a; }
+
+/* FORMS */
+form.wide label { display: block; font-weight: bold; margin-top: 1.5em; margin-bottom: 0;}
+form.wide label span { font-weight: normal; color: #555; }
+form.wide input,
+form.wide textarea,
+form.wide select { width: 99%; padding: 1px; }
+form.wide p { margin: 0; }
+form.wide p.submit { text-align: right; margin-top: 1em; margin-right: 0;}
+form.wide p.submit input { width: 10em; font-size: 1.5em; }
+form.wide p.errors { margin: 0; padding: 0; font-weight: bold; color: red; }
+
+/* MISC */
+
+.small { font-size:90%; }
+h3 .small { font-size:80%; }
+.quiet { font-weight:normal; }
+.clear { clear:both; }
+#content-main .quiet { color:#487858; }
+#content-secondary .quiet { color:#90ba9e; }
+
+/* CLEARFIX KLUDGE */
+
+#columnwrap:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+}
+#columnwrap { display: inline-block; }
+
+/* Hides from IE-mac \*/
+* html #columnwrap { height: 1%; }
+#columnwrap { display: block; }
+/* End hide from IE-mac */
+
+#subwrap:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+}
+#subwrap { display: inline-block; }
+
+/* Hides from IE-mac \*/
+* html #subwrap { height: 1%; }
+#subwrap { display: block; }
+/* End hide from IE-mac */om IE-mac */
4 django_website/media/css/homepage.css
View
@@ -0,0 +1,4 @@
+@import url(base.css);
+
+.button-download { display:block; background:url(http://media.djangoproject.com/img/site/download_bg-left.gif) no-repeat; }
+.button-download a { height:18px; color:white; display:block; white-space:nowrap; background:url(http://media.djangoproject.com/img/site/download_bg-right.gif) top right no-repeat; padding:6px 12px; }
22 django_website/media/css/print.css
View
@@ -0,0 +1,22 @@
+@import url(base.css);
+
+@page {
+ size: US-Letter;
+ margin: .75in .5in .75in 1in;
+}
+
+body { font-size:10pt; background: white; color: black; }
+
+/* Hide unneccessary content */
+#header, #billboard, #content-extra, #documentation #content-secondary, #documentation #content-related, h2.deck { display:none; }
+
+/* Fix widths */
+#container { width:7in; }
+#subwrap, #content-main { width:7in; float:none; }
+
+/* Formatting and display fixes */
+#content { border-top:none; }
+.literal-block { overflow:visible; }
+
+/* Typographic adjustments */
+#content-main p, #content-main h2, #content-main h3, #content-main h4 { margin-bottom:1em; }
BIN  django_website/media/img/doc/icons/docicons-behindscenes.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/doc/icons/docicons-note.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/doc/icons/docicons-philosophy.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/site/bbd_blogroll.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/site/bbd_code.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/site/bbd_community.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/site/bbd_documentation.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/site/bbd_download.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/site/bbd_homepage.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/site/bbd_overview.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/site/bbd_weblog.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/site/bbdsm_bg.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/site/bbdsm_bg.gif.1
View
Binary file not shown
BIN  django_website/media/img/site/hdr_logo.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/site/mt.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  django_website/media/img/site/nav_bg.gif
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 django_website/settings.py
View
@@ -18,7 +18,10 @@
PREPEND_WWW = False
CACHE_BACKEND = "dummy:///"
DJANGO_SVN_ROOT = "http://code.djangoproject.com/svn/django/"
- ADMIN_MEDIA_PREFIX = '/media/'
+ ADMIN_MEDIA_PREFIX = '/static/'
+ # FIXME: Really need to pull in actual media to serve so we can do this offline.
+ MEDIA_ROOT = os.path.join(os.path.dirname(__file__), "media")
+ MEDIA_URL = "/media/"
else:
DEBUG = False
PREPEND_WWW = True
@@ -27,6 +30,8 @@
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/"
SITE_ID = 1
ROOT_URLCONF = 'django_website.urls'
@@ -46,8 +51,6 @@
'django_website.apps.aggregator',
'registration',
)
-MEDIA_ROOT = "/home/html/djangoproject.com/m/"
-MEDIA_URL = "http://www.djangoproject.com.com/m/"
# setting for documentation root path
DJANGO_DOCUMENT_ROOT_PATH = "/home/html/djangoproject.com/docs/"
@@ -56,16 +59,16 @@
CACHE_MIDDLEWARE_SECONDS = 60 * 5 # 5 minutes
CACHE_MIDDLEWARE_KEY_PREFIX = 'djangoproject'
CACHE_MIDDLEWARE_GZIP = True
-CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
+#CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
MIDDLEWARE_CLASSES = (
- 'django.middleware.http.SetRemoteAddrFromForwardedFor',
+ 'django.middleware.cache.UpdateCacheMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.common.CommonMiddleware',
- 'django.middleware.cache.CacheMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
+ 'django.middleware.cache.FetchFromCacheMiddleware',
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
16 django_website/templates/aggregator/add_feed.html
View
@@ -0,0 +1,16 @@
+{% extends "base_community.html" %}
+
+{% block content %}
+
+<h1>Community</h1>
+
+<form method="POST" action="" id="add_feed_form">
+ {{ form.as_p }}
+ <input type="submit" name="submit" value="Add Feed" />
+</form>
+
+<div id="content-secondary">
+{% if has_next %}<a href="?page={{ next }}">Earlier posts</a>{% endif %}</p>
+</div>
+
+{% endblock %}
3  django_website/templates/aggregator/feeditem_list.html
View
@@ -7,8 +7,7 @@
{% block content %}
<h1>Community</h1>
-<h2 class="deck">This page, updated every hour, aggregates blog entries by people who are
-writing about Django.</h2>
+<h2 class="deck">This page, updated every hour, aggregates what's going on in the community.</h2>
{% for item in object_list %}
<h2><a href="{{ item.link }}">{{ item.title }}</a></h2>
14 django_website/templates/aggregator/feedtype_list.html
View
@@ -0,0 +1,14 @@
+{% extends "base_community.html" %}
+
+{% block content %}
+
+<h1>Community</h1>
+<h2 class="deck">This page, updated every hour, aggregates what's going on in the community.</h2>
+
+<h3>Pick which list to add your feed to: <em><small>(only one)</small></em></h3>
+<ul>
+ {% for item in object_list %}
+ <li><a href="{% url community-add-feed item.slug %}">{{ item }}</a></li>
+ {% endfor %}
+</ul>
+{% endblock %}
63 django_website/templates/aggregator/index.html
View
@@ -0,0 +1,63 @@
+{% extends "base_community.html" %}
+
+{% block extrahead %}
+<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss/community/" />
+{% endblock %}
+
+{% block content %}
+<h1>Community</h1>
+<h2 class="deck">This page, updated every hour, aggregates what's going on in the community.</h2>
+
+{% for feedtype in feedtype_list %}
+<div id="{{ feedtype.slug }}" class="module {% cycle "first" "last" %}">
+ <h3 class="header">{{ feedtype.name }}</h3>
+ {% for item in feedtype.items|slice:":5" %}
+ <h5><a href="{{ item.link }}">{{ item.title }}</a></h5>
+ <p class="date">{{ item.date_modified|date:"N jS, Y \a\t P" }} by <a href="{{ item.feed.public_url }}">{{ item.feed.title }}</a></p>
+ {% endfor %}
+ <p style="padding-left: 10px;"><a href="{% url community-feed-list feedtype.slug %}">View more</a>{% if feedtype.can_self_add %} or <a href="{% url community-add-feed feedtype.slug %}">Add your feed</a>{% endif %}</p>
+</div>
+{% endfor %}
+
+{% comment %}
+
+<div id="blogs" class="module first">
+ <h3 class="header">Recent Blog Posts</h3>
+ {% for article in article_list|slice:":5" %}
+ <h5><a href="{{ article.link }}">{{ article.title }}</a></h5>
+ <p class='date'>{{ article.date_modified|date:"N jS, Y \a\t P" }} by <a href="{{ article.feed.public_url }}">{{ article.feed.title }}</a></p>
+ {% endfor %}
+ <p style="padding-left: 10px;"><a href="{% url community-feed-list 'articles' %}">View more</a> or <a href="{% url community-add-feed "articles" %}">Add your feed</a></p>
+</div>
+
+<div class="module last" id="jobs">
+ <h3 class="header">Recently Posted Jobs</h3>
+ {% for job in job_list|slice:":5" %}
+ <h5><a href="{{ job.link }}">{{ job.title }}</a></h5>
+ <p class='date'>{{ job.date_modified|date:"N jS, Y \a\t P" }} by <a href="{{ job.feed.public_url }}">{{ job.feed.title }}</a></p>
+ {% endfor %}
+</div>
+<hr style="clear: both; display: block; border: none; background-color: white; color: white;" />
+<div class="module" id="pypi">
+ <h3 class="header">Recently On PyPi</h3>
+ {% for package in pypi_list|slice:":5" %}
+ <h5><a href="{{ package.link }}">{{ package.title }}</a></h5>
+ <p>{{ package.summary }}</p>
+ {% endfor %}
+</div>
+
+<div class="module" id="elsewhere">
+ <h3 class="header">Recently External Development</h3>
+ {% for project in external_dev_list|slice:":5" %}
+ <h5><a href="{{ project.link }}">{{ project.feed.title }}</a></h5>
+ <p>{{ project.title }}</p>
+ {% endfor %}
+</div>
+{% endcomment %}
+
+<hr style="height: 35px; display: block; clear: both; visibility: hidden;" />
+<div id="content-secondary">
+{% if has_next %}<a href="?page={{ next }}">Earlier posts</a>{% endif %}</p>
+</div>
+
+{% endblock %}
8 django_website/templates/base.html
View
@@ -15,8 +15,8 @@
<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="http://media.djangoproject.com/css/{% block cssid %}base{% endblock %}.css" rel="stylesheet" type="text/css" media="screen" />
- <link href="http://media.djangoproject.com/css/print.css" rel="stylesheet" type="text/css" media="print" />
+ <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>
@@ -24,7 +24,7 @@
<div id="container">
<div id="header">
- <h1 id="logo"><a href="http://www.djangoproject.com/"><img src="http://media.djangoproject.com/img/site/hdr_logo.gif" alt="Django" /></a></h1>
+ <h1 id="logo"><a href="http://www.djangoproject.com/"><img src="{{ MEDIA_URL }}img/site/hdr_logo.gif" alt="Django" /></a></h1>
<ul id="nav-global">
<li id="nav-homepage"><a href="http://www.djangoproject.com/">Home</a></li>
<li id="nav-download"><a href="http://www.djangoproject.com/download/">Download</a></li>
@@ -48,7 +48,7 @@ <h1 id="logo"><a href="http://www.djangoproject.com/"><img src="http://media.dja
<div id="footer">
<p>&copy; 2005-{% now "Y" %} <a href="http://www.djangoproject.com/foundation/">Django Software Foundation</a> unless otherwise noted. Django is a registered trademark of the Django Software Foundation.
Hosting graciously provided by <a href="http://mediatemple.net/">
- <img style="vertical-align: middle; position: relative; top: -1px;" src="http://media.djangoproject.com/img/site/mt.png" alt="media temple" /></a>
+ <img style="vertical-align: middle; position: relative; top: -1px;" src="{{ MEDIA_URL }}img/site/mt.png" alt="media temple" /></a>
</p>
</div>
<!-- END #footer -->
15 django_website/templates/base_community.html
View
@@ -7,7 +7,6 @@
{% block billboard %}<h2>Community</h2>{% endblock %}
{% block content-related %}
-
<h2>Get involved</h2>
<ul>
@@ -33,11 +32,10 @@
<h2>Tell the world</h2>
<ul>
-<li><a href="http://code.djangoproject.com/wiki/DjangoPoweredSites">Django-powered sites</a> &mdash; add your site to the list</li>
+<li><a href="http://djangosites.org/">Django-powered sites</a> &mdash; add your site to the list</li>
<li><a href="/community/badges/">Django badges</a> &mdash; show your support (or wish longingly)</li>
<li><a href="/community/logos/">Django logos</a> &mdash; download official logos</li>
<li><a href="/weblog/2005/nov/11/desktops/">Django wallpaper</a> &mdash; cover your desktop</li>
-<li>Write about Django, and <a href="mailto:jacob@jacobian.org">let us know</a>, and we'll add your feed to this page.</li>
</ul>
<h2>Improve Django</h2>
@@ -54,15 +52,4 @@
<li><strong>Chat live with other Django users</strong> in the <a href="irc://irc.freenode.net/django">#django IRC channel on irc.freenode.net</a>.</li>
<li><strong>Ask questions</strong> on the <a href="http://groups-beta.google.com/group/django-users">django-users mailing list</a>.</li>
</ul>
-
-<h2>Authors</h2>
-
-<ul>
-{% load aggregator %}
-{% get_feed_list as feed_list %}
-{% for feed in feed_list %}
-<li><a href="{{ feed.public_url }}">{{ feed }}</a> <a class="rss" href="{{ feed.feed_url }}">RSS</a></li>
-{% endfor %}
-</ul>
-<p>Do you write about Django? <a href="mailto:jacob@jacobian.org">Let us know</a>, and we'll add your feed to this page.</p>
{% endblock %}
2  django_website/templates/homepage.html
View
@@ -35,7 +35,7 @@ <h2 class="deck">Django is a high-level Python Web framework that encourages rap
<h2>Download</h2>
<ul class="linklist">
- <li class="button-download"><a href="/download/">Latest release: <strong>1.2.1</strong></a></li>
+ <li class="button-download"><a href="/download/">Latest release: <strong>1.1.1</strong></a></li>
</ul>
<p>Open source, <a href="http://code.djangoproject.com/browser/django/trunk/LICENSE">BSD license</a></p>
<h2>Documentation</h2>
2  django_website/upgrade/add_community.sql
View
@@ -0,0 +1,2 @@
+ALTER TABLE aggregator_feedtype
+ADD COLUMN can_self_add boolean not null default 'true';
28 django_website/urls.py
View
@@ -37,15 +37,35 @@
(r'^admin/(.*)', admin.site.root),
(r'^comments/$', 'django.views.generic.list_detail.object_list', comments_info_dict),
(r'^comments/', include('django.contrib.comments.urls')),
- (r'^community/$', 'django.views.generic.list_detail.object_list', aggregator_info_dict),
- (r'^contact/', include('django_website.apps.contact.urls')),
- (r'^documentation/', include('django_website.apps.docs.urls')),
+ url(r'^community/add/(?P<feed_type_slug>[-\w]+)/',
+ 'django_website.apps.aggregator.views.add_feed',
+ name='community-add-feed'),
+ url(r'^community/add/',
+ 'django_website.apps.aggregator.views.feed_type_list',
+ name="community-add-feed-list"),
+ url(r'^community/(?P<feed_type_slug>[-\w]+)/',
+ 'django_website.apps.aggregator.views.feed_list',
+ name="community-feed-list"),
+ url(r'^community/', 'django_website.apps.aggregator.views.index', name='community-index'),
+ # (r'^contact/', include('django_website.apps.contact.urls')),
+ # (r'^documentation/', include('django_website.apps.docs.urls')),
(r'^r/', include('django.conf.urls.shortcut')),
(r'^rss/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
(r'^sitemap\.xml$', cache_page(sitemap_views.sitemap, 60 * 60 * 6), {'sitemaps': sitemaps}),
(r'^weblog/', include('django_website.apps.blog.urls')),
(r'^freenode\.9xJY7YIUWtwn\.html$', 'django.views.generic.simple.direct_to_template', {'template': 'freenode_tmp.html'}),
+)
+
+if settings.DEVELOPMENT_MODE:
+ urlpatterns += patterns("django.views",
+ url(r"^media/(?P<path>.*)", "static.serve", {
+ "document_root": settings.MEDIA_ROOT,
+ }),
+ )
+
+urlpatterns += patterns('',
+ # flatpages need to be last b/c they match anything
(r'', include('django.contrib.flatpages.urls')),
)
-admin.autodiscover()
+admin.autodiscover()
Please sign in to comment.
Something went wrong with that request. Please try again.