Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Get rid of vestigial django_website.views.

  • Loading branch information...
commit b50caf0057f3fd7ab9859534e340076d568ad38b 1 parent b76acc1
Aymeric Augustin aaugustin authored
Showing with 6 additions and 13 deletions.
  1. +0 −9 django_website/views.py
  2. +6 −4 django_www/urls.py
9 django_website/views.py
View
@@ -1,9 +0,0 @@
-from django.shortcuts import render
-from django.views.decorators.csrf import requires_csrf_token
-
-@requires_csrf_token
-def server_error(request, template_name='500.html'):
- """
- Custom 500 error handler for static stuff.
- """
- return render(request, template_name)
10 django_www/urls.py
View
@@ -4,8 +4,9 @@
from django.contrib import admin
from django.contrib.flatpages.views import flatpage
from django.contrib.sitemaps import views as sitemap_views
+from django.shortcuts import render
from django.views.decorators.cache import cache_page
-from django.views.decorators.csrf import csrf_exempt
+from django.views.decorators.csrf import csrf_exempt, requires_csrf_token
from django.views.generic import RedirectView, TemplateView
from accounts import views as account_views
@@ -21,9 +22,6 @@
'flatpages': FlatPageSitemap,
}
-handler500 = 'django_website.views.server_error'
-
-
urlpatterns = patterns('',
url(r'^$', TemplateView.as_view(template_name='homepage.html'), name="homepage"),
url(r'^accounts/', include('accounts.urls')),
@@ -54,3 +52,7 @@
url(r'^svntogit/', include('svntogit.urls')),
url(r'', include('legacy.urls')),
)
+
+@requires_csrf_token
+def handler500(request):
+ return render(request, '500.html')
Please sign in to comment.
Something went wrong with that request. Please try again.