Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-cas
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-cas
Commits
ac32aa8a
Commit
ac32aa8a
authored
Jun 18, 2008
by
Brodie Rao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated custom forbidden template example in the README to use RequestContext
parent
0dce5e03
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
README.txt
+2
-2
No files found.
README.txt
View file @
ac32aa8a
...
@@ -117,13 +117,13 @@ For example, in `views.py`:
...
@@ -117,13 +117,13 @@ For example, in `views.py`:
{{{
{{{
from django.http import HttpResponseForbidden
from django.http import HttpResponseForbidden
from django.template import Context, loader
from django.template import
Request
Context, loader
def forbidden(request, template_name='403.html'):
def forbidden(request, template_name='403.html'):
"""Default 403 handler"""
"""Default 403 handler"""
t = loader.get_template(template_name)
t = loader.get_template(template_name)
return HttpResponseForbidden(t.render(
Context({}
)))
return HttpResponseForbidden(t.render(
RequestContext(request
)))
}}}
}}}
And in `middleware.py`:
And in `middleware.py`:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment