Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Worked around PayPal POSTing to the donation thank-you page.

  • Loading branch information...
commit cfc20583095334a8e8def4186d8cb9122eb8e217 1 parent dbc644f
Jacob Kaplan-Moss authored March 23, 2011
18  django_website/templates/donate_thanks.html
... ...
@@ -0,0 +1,18 @@
  1
+{% extends "flatpages/foundation.html" %}
  2
+
  3
+{% block title %}Thanks for your support!{% endblock %}
  4
+
  5
+{% block content %}
  6
+<h1>Thanks for your support!</h1>
  7
+<h2 class="deck">Thank you for supporting Django. If you like, you can use one of the badges below to show your support and help us bring in other donors.</h2>
  8
+
  9
+<p>Copy and paste the source below each image to link to our donation page.</p>
  10
+
  11
+<h3><a href="http://www.djangoproject.com/foundation/donate/"><img src="http://media.djangoproject.com/img/badges/djangodonated126x54.gif" border="0" alt="I donated to Django" width="126" height="54" /></a></h3>
  12
+
  13
+<p><textarea rows="3" cols="60" class="codedump"><a href="http://www.djangoproject.com/foundation/donate/"><img src="http://media.djangoproject.com/img/badges/djangodonated126x54.gif" border="0" alt="I donated to Django" width="126" height="54" /></a></textarea><br /><strong>126x54</strong> I donated to Django (green)</p>
  14
+
  15
+<h3><a href="http://www.djangoproject.com/foundation/donate/"><img src="http://media.djangoproject.com/img/badges/djangodonated126x54_grey.png" border="0" alt="I donated to Django" width="126" height="54" /></a></h3>
  16
+
  17
+<p><textarea rows="3" cols="60" class="codedump"><a href="http://www.djangoproject.com/foundation/donate/"><img src="http://media.djangoproject.com/img/badges/djangodonated126x54_grey.png" border="0" alt="I donated to Django" width="126" height="54" /></a></textarea><br /><strong>126x54</strong> I donated to Django (grey)</p>
  18
+{% endblock %}
7  django_website/urls/www.py
@@ -5,6 +5,7 @@
5 5
 from django.contrib import admin; admin.autodiscover()
6 6
 from django.contrib.comments.feeds import LatestCommentFeed
7 7
 from django.contrib.comments.models import Comment
  8
+from django.contrib.flatpages.views import flatpage
8 9
 from django.contrib.sitemaps import views as sitemap_views
9 10
 from django.views.decorators.cache import cache_page
10 11
 from django.views.generic.simple import redirect_to
@@ -39,10 +40,14 @@
39 40
     url(r'^rss/community/firehose/$', CommunityAggregatorFirehoseFeed(), name='aggregator-firehose-feed'),
40 41
     url(r'^rss/community/(?P<slug>[\w-]+)/$', CommunityAggregatorFeed(), name='aggregator-feed'),
41 42
 
  43
+    # PayPal insists on POSTing to the "thank you" page which means we can't
  44
+    # just use a flatpage for it.
  45
+    url(r'^foundation/donate/thanks/$', 'django_website.views.donate_thanks'),
  46
+
42 47
     url(r'^sitemap\.xml$', cache_page(sitemap_views.sitemap, 60 * 60 * 6), {'sitemaps': sitemaps}),
43 48
     url(r'^weblog/', include('django_website.blog.urls')),
44 49
     url(r'^freenode\.9xJY7YIUWtwn\.html$', 'django.views.generic.simple.direct_to_template', {'template': 'freenode_tmp.html'}),
45  
-    url(r'^download$', 'django.contrib.flatpages.views.flatpage', {'url': 'download'}, name="download"),
  50
+    url(r'^download$', flatpage, {'url': 'download'}, name="download"),
46 51
     url(r'', include('django_website.legacy.urls')),
47 52
 )
48 53
 
7  django_website/views.py
@@ -6,6 +6,7 @@
6 6
 from django.contrib.comments.models import Comment
7 7
 from django.contrib.sitemaps import views as sitemap_views
8 8
 from django.views.decorators.cache import cache_page
  9
+from django.views.decorators.csrf import csrf_exempt
9 10
 from django.views.generic import list_detail
10 11
 from django.views.generic.simple import direct_to_template
11 12
 from .sitemaps import FlatPageSitemap, WeblogSitemap
@@ -25,4 +26,8 @@ def comments(request):
25 26
         request,
26 27
         queryset = Comment.objects.filter(is_public=True).order_by('-submit_date'),
27 28
         paginate_by = 30,
28  
-    )
  29
+    )
  30
+
  31
+@csrf_exempt
  32
+def donate_thanks(request):
  33
+    return direct_to_template(request, 'donate_thanks.html')

0 notes on commit cfc2058

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