author | Primal Pappachan <primal007@gmail.com> |
Fri, 02 Dec 2011 16:11:19 +0530 | |
branch | 2011 |
changeset 474 | 83ea39f44032 |
parent 429 | cde70fd3073c |
permissions | -rw-r--r-- |
429
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
1 |
from django.shortcuts import render_to_response |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
2 |
from django.template import RequestContext |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
3 |
from django.conf import settings |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
4 |
|
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
5 |
|
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
6 |
def handler404(request, template_name='404.html'): |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
7 |
""" |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
8 |
Loads 404 page while passing scope |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
9 |
""" |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
10 |
scope = settings.CURRENT_SCOPE |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
11 |
return render_to_response(template_name, RequestContext(request, { |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
12 |
'params': {'scope': scope}, |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
13 |
})) |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
14 |
|
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
15 |
def handler500(request, template_name='500.html'): |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
16 |
""" |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
17 |
Loads 500 page while passing scope |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
18 |
""" |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
19 |
scope = settings.CURRENT_SCOPE |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
20 |
return render_to_response(template_name, RequestContext(request, { |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
21 |
'params': {'scope': scope}, |
cde70fd3073c
changed the handler404 and handler500 to a custom view, passing scope to get proper formed urls when displaying 404 and 500 pages
Parth buch <parth.buch.115@gmail.com>
parents:
diff
changeset
|
22 |
})) |