project/scipycon/views.py
author primal primal007@gmail.com
Mon, 30 Jan 2012 15:19:23 +0530
branch2011
changeset 522 01b130ea8d8d
parent 429 cde70fd3073c
permissions -rw-r--r--
Merged
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
    }))