File tree Expand file tree Collapse file tree 4 files changed +67
-0
lines changed Expand file tree Collapse file tree 4 files changed +67
-0
lines changed Original file line number Diff line number Diff line change
1
+ {% extends 'base.html' %}
2
+ {% load static %}
3
+ {% block content %}
4
+ < section class ="main-section ">
5
+ < div class ="container ">
6
+ < div class ="jumbotron text-center ">
7
+ < h1 > 403</ h1 >
8
+ < h4 > Permission Denied. You don't have access to this file.</ h4 >
9
+ < br />
10
+ < a href ="# " onClick ="history.go(-1); return false; " class ="btn btn-default "> Go Back</ a >
11
+ </ div >
12
+ </ div >
13
+ </ section >
14
+ {% endblock %}
Original file line number Diff line number Diff line change
1
+ {% extends 'base.html' %}
2
+ {% load static %}
3
+ {% block content %}
4
+ < section class ="main-section ">
5
+ < div class ="container ">
6
+ < div class ="jumbotron text-center ">
7
+ < h1 > 404</ h1 >
8
+ < h4 > Woops! Page not found.</ h4 >
9
+ < br />
10
+ < a href ="# " onClick ="history.go(-1); return false; " class ="btn btn-default "> Go Back</ a >
11
+ </ div >
12
+ </ div >
13
+ </ section >
14
+ {% endblock %}
Original file line number Diff line number Diff line change
1
+ {% extends 'base.html' %}
2
+ {% load static %}
3
+ {% block content %}
4
+ < section class ="main-section ">
5
+ < div class ="container ">
6
+ < div class ="jumbotron text-center ">
7
+ < h1 > 500</ h1 >
8
+ < h4 > Internal Server Error.</ h4 >
9
+ < br />
10
+ < a href ="# " onClick ="history.go(-1); return false; " class ="btn btn-default "> Go Back</ a >
11
+ </ div >
12
+ </ div >
13
+ </ section >
14
+ {% endblock %}
Original file line number Diff line number Diff line change 1
1
from django .shortcuts import render
2
2
3
+ from django .shortcuts import render_to_response
4
+
5
+ from django .template import RequestContext
6
+
3
7
from main .models import chatSession
4
8
5
9
@@ -11,3 +15,24 @@ def home(request):
11
15
12
16
def request_session (request ):
13
17
return render (request , 'session.html' )
18
+
19
+
20
+ def handler404 (request ):
21
+ response = render_to_response ('404.html' , {},
22
+ context_instance = RequestContext (request ))
23
+ response .status_code = 404
24
+ return response
25
+
26
+
27
+ def handler500 (request ):
28
+ response = render_to_response ('500.html' , {},
29
+ context_instance = RequestContext (request ))
30
+ response .status_code = 500
31
+ return response
32
+
33
+
34
+ def handler403 (request ):
35
+ response = render_to_response ('403.html' , {},
36
+ context_instance = RequestContext (request ))
37
+ response .status_code = 403
38
+ return response
You can’t perform that action at this time.
0 commit comments