Commit 793b9f73 authored by Benjamin S Waters's avatar Benjamin S Waters
Browse files

more readme tweaks

parent 262f98fd
......@@ -23,9 +23,7 @@ CAS 2.0 functionality.)
Now add it to the middleware and authentication backends in your settings.
Make sure you also have the authentication middleware installed. Here's what
mine looks like:
mine looks like::
......@@ -61,8 +59,8 @@ Optional settings include:
Make sure your project knows how to log users in and out by adding these to
your URL mappings::
(r'\^login/$', 'django_gmucas.views.login'),
(r'\^logout/$', 'django_gmucas.views.logout'),
(r'\^login/$', 'django_gmucas.views.login'),
(r'\^logout/$', 'django_gmucas.views.logout'),
Users should now be able to log into your site (and staff into the
administration interface) using CAS.
......@@ -90,7 +88,6 @@ To add user data, subclass `CASBackend` and specify that as your
application's backend.
For example::
from django_gmucas.backends import CASBackend
class PopulatedCASBackend(CASBackend):
......@@ -130,6 +127,7 @@ Django doesn't provide a simple way to customize 403 error pages, so you'll
have to make a response middleware that handles `HttpResponseForbidden`.
For example, in ``::
from django.http import HttpResponseForbidden
from django.template import RequestContext, loader
......@@ -140,8 +138,8 @@ For example, in ``::
return HttpResponseForbidden(t.render(RequestContext(request)))
And in ``::
from django.http import HttpResponseForbidden
from django.http import HttpResponseForbidden
from yourapp.views import forbidden
class Custom403Middleware(object):
......@@ -154,6 +152,7 @@ And in ``::
return response
Now add `yourapp.middleware.Custom403Middleware` to your `MIDDLEWARE_CLASSES`
setting and create a template named `403.html`.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment