On Thu, 10 May 2012 23:56:50 -0700 (PDT)
Johan <djjord...@gmail.com> wrote:

> Hi thanks for the quick reply. After some more investigation I am quite 
> sure that this is exactly the issue. Thanks again for the quick reply. Now 
> to just find an elegant way to let the user know that they need to have 
> Cookies enabled to access my site :)

You could specify the CSRF_FAILURE_VIEW setting in your settings.py to
point to a custom view that renders a simple template telling the user
that they need cookies enabled. For instance:

  # setting.spy

  CSRF_FAILURE_VIEW = 'app.views.csrf_failure'

  # app/views.py

  from django.shortcuts import render

  def csrf_failure(request, reason=None):
      # Use status code 403 Forbidden here.
      return render(request, 'csrf.html', status=403)

  # templates/csrf.html

  Some text explaining that cookies need to be enabled.

Best wishes,
Sebastian.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to