Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit cfc20583095334a8e8def4186d8cb9122eb8e217 1 parent dbc644f
@jacobian jacobian authored
View
18 django_website/templates/donate_thanks.html
@@ -0,0 +1,18 @@
+{% extends "flatpages/foundation.html" %}
+
+{% block title %}Thanks for your support!{% endblock %}
+
+{% block content %}
+<h1>Thanks for your support!</h1>
+<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>
+
+<p>Copy and paste the source below each image to link to our donation page.</p>
+
+<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>
+
+<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>
+
+<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>
+
+<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>
+{% endblock %}
View
7 django_website/urls/www.py
@@ -5,6 +5,7 @@
from django.contrib import admin; admin.autodiscover()
from django.contrib.comments.feeds import LatestCommentFeed
from django.contrib.comments.models import Comment
+from django.contrib.flatpages.views import flatpage
from django.contrib.sitemaps import views as sitemap_views
from django.views.decorators.cache import cache_page
from django.views.generic.simple import redirect_to
@@ -39,10 +40,14 @@
url(r'^rss/community/firehose/$', CommunityAggregatorFirehoseFeed(), name='aggregator-firehose-feed'),
url(r'^rss/community/(?P<slug>[\w-]+)/$', CommunityAggregatorFeed(), name='aggregator-feed'),
+ # PayPal insists on POSTing to the "thank you" page which means we can't
+ # just use a flatpage for it.
+ url(r'^foundation/donate/thanks/$', 'django_website.views.donate_thanks'),
+
url(r'^sitemap\.xml$', cache_page(sitemap_views.sitemap, 60 * 60 * 6), {'sitemaps': sitemaps}),
url(r'^weblog/', include('django_website.blog.urls')),
url(r'^freenode\.9xJY7YIUWtwn\.html$', 'django.views.generic.simple.direct_to_template', {'template': 'freenode_tmp.html'}),
- url(r'^download$', 'django.contrib.flatpages.views.flatpage', {'url': 'download'}, name="download"),
+ url(r'^download$', flatpage, {'url': 'download'}, name="download"),
url(r'', include('django_website.legacy.urls')),
)
View
7 django_website/views.py
@@ -6,6 +6,7 @@
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.decorators.csrf import csrf_exempt
from django.views.generic import list_detail
from django.views.generic.simple import direct_to_template
from .sitemaps import FlatPageSitemap, WeblogSitemap
@@ -25,4 +26,8 @@ def comments(request):
request,
queryset = Comment.objects.filter(is_public=True).order_by('-submit_date'),
paginate_by = 30,
- )
+ )
+
+@csrf_exempt
+def donate_thanks(request):
+ return direct_to_template(request, 'donate_thanks.html')

0 comments on commit cfc2058

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