Skip to content
Snippets Groups Projects
Commit 5f7363c7 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

Custom http errors

parent 0e78640b
No related branches found
No related tags found
No related merge requests found
{% load static %}<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Scheduling System | Error page</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
{% block styles %}
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="{% static 'AdminLTE/css/bootstrap.min.css' %}">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="{% static 'AdminLTE/css/AdminLTE.min.css' %}">
<link rel="stylesheet" href="{% static 'AdminLTE/css/skins/skin-green.min.css' %}">
<!-- iCheck -->
<link rel="stylesheet" href="{% static 'AdminLTE/plugins/iCheck/square/blue.css' %}">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
.login-logo-h5 {
margin-top: -10px;
}
.login-page-bg {
background: url('{% static 'background.jpg' %}');
}
</style>
{% endblock styles %}
</head>
<body class="hold-transition login-page login-page-bg">
<div class="login-box">
<div class="login-box-body">
<div class="login-logo">
<b>SMA</b>SCH
<h5 class="login-logo-h5">(Smart Scheduling)</h5>
</div>
<!-- /.login-logo -->
<div class="callout callout-danger">
<h4>Sorry, there were some problems handling your request</h4>
<p>Bad request.</p>
</div>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
{% block scripts %}
<!-- jQuery 2.2.3 -->
<script src="{% static 'AdminLTE/plugins/jQuery/jquery-2.2.3.min.js' %}"></script>
<!-- Bootstrap 3.3.6 -->
<script src="{% static 'AdminLTE/js/bootstrap.min.js' %}"></script>
<!-- iCheck -->
<script src="{% static 'AdminLTE/plugins/iCheck/icheck.min.js' %}"></script>
<script>
$(document).ready(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
</script>
{% endblock scripts %}
</body>
</html>
{% load static %}<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Scheduling System | Error page</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
{% block styles %}
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="{% static 'AdminLTE/css/bootstrap.min.css' %}">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="{% static 'AdminLTE/css/AdminLTE.min.css' %}">
<link rel="stylesheet" href="{% static 'AdminLTE/css/skins/skin-green.min.css' %}">
<!-- iCheck -->
<link rel="stylesheet" href="{% static 'AdminLTE/plugins/iCheck/square/blue.css' %}">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
.login-logo-h5 {
margin-top: -10px;
}
.login-page-bg {
background: url('{% static 'background.jpg' %}');
}
</style>
{% endblock styles %}
</head>
<body class="hold-transition login-page login-page-bg">
<div class="login-box">
<div class="login-box-body">
<div class="login-logo">
<b>SMA</b>SCH
<h5 class="login-logo-h5">(Smart Scheduling)</h5>
</div>
<!-- /.login-logo -->
<div class="callout callout-danger">
<h4>Sorry, there were some problems handling your request</h4>
<p>Permission denied.</p>
</div>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
{% block scripts %}
<!-- jQuery 2.2.3 -->
<script src="{% static 'AdminLTE/plugins/jQuery/jquery-2.2.3.min.js' %}"></script>
<!-- Bootstrap 3.3.6 -->
<script src="{% static 'AdminLTE/js/bootstrap.min.js' %}"></script>
<!-- iCheck -->
<script src="{% static 'AdminLTE/plugins/iCheck/icheck.min.js' %}"></script>
<script>
$(document).ready(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
</script>
{% endblock scripts %}
</body>
</html>
{% load static %}<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Scheduling System | Error page</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
{% block styles %}
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="{% static 'AdminLTE/css/bootstrap.min.css' %}">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="{% static 'AdminLTE/css/AdminLTE.min.css' %}">
<link rel="stylesheet" href="{% static 'AdminLTE/css/skins/skin-green.min.css' %}">
<!-- iCheck -->
<link rel="stylesheet" href="{% static 'AdminLTE/plugins/iCheck/square/blue.css' %}">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
.login-logo-h5 {
margin-top: -10px;
}
.login-page-bg {
background: url('{% static 'background.jpg' %}');
}
</style>
{% endblock styles %}
</head>
<body class="hold-transition login-page login-page-bg">
<div class="login-box">
<div class="login-box-body">
<div class="login-logo">
<b>SMA</b>SCH
<h5 class="login-logo-h5">(Smart Scheduling)</h5>
</div>
<!-- /.login-logo -->
<div class="callout callout-danger">
<h4>Sorry, there were some problems handling your request</h4>
<p>The requested page does not exist.</p>
</div>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
{% block scripts %}
<!-- jQuery 2.2.3 -->
<script src="{% static 'AdminLTE/plugins/jQuery/jquery-2.2.3.min.js' %}"></script>
<!-- Bootstrap 3.3.6 -->
<script src="{% static 'AdminLTE/js/bootstrap.min.js' %}"></script>
<!-- iCheck -->
<script src="{% static 'AdminLTE/plugins/iCheck/icheck.min.js' %}"></script>
<script>
$(document).ready(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
</script>
{% endblock scripts %}
</body>
</html>
{% load static %}<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Scheduling System | Error page</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
{% block styles %}
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="{% static 'AdminLTE/css/bootstrap.min.css' %}">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="{% static 'AdminLTE/css/AdminLTE.min.css' %}">
<link rel="stylesheet" href="{% static 'AdminLTE/css/skins/skin-green.min.css' %}">
<!-- iCheck -->
<link rel="stylesheet" href="{% static 'AdminLTE/plugins/iCheck/square/blue.css' %}">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
.login-logo-h5 {
margin-top: -10px;
}
.login-page-bg {
background: url('{% static 'background.jpg' %}');
}
</style>
{% endblock styles %}
</head>
<body class="hold-transition login-page login-page-bg">
<div class="login-box">
<div class="login-box-body">
<div class="login-logo">
<b>SMA</b>SCH
<h5 class="login-logo-h5">(Smart Scheduling)</h5>
</div>
<!-- /.login-logo -->
<div class="callout callout-danger">
<h4>Sorry, there were some problems handling your request</h4>
<p>Internet server error.</p>
</div>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
{% block scripts %}
<!-- jQuery 2.2.3 -->
<script src="{% static 'AdminLTE/plugins/jQuery/jquery-2.2.3.min.js' %}"></script>
<!-- Bootstrap 3.3.6 -->
<script src="{% static 'AdminLTE/js/bootstrap.min.js' %}"></script>
<!-- iCheck -->
<script src="{% static 'AdminLTE/plugins/iCheck/icheck.min.js' %}"></script>
<script>
$(document).ready(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
</script>
{% endblock scripts %}
</body>
</html>
...@@ -12,12 +12,33 @@ from django.db.models import Q ...@@ -12,12 +12,33 @@ from django.db.models import Q
import collections import collections
import datetime import datetime
# See https://docs.djangoproject.com/en/1.10/topics/http/views/#customizing-error-views
# They should work ONLY in production! (DEBUG=False)
handler404 = 'web.views.e404_page_not_found'
handler500 = 'web.views.e500_error'
handler403 = 'web.views.e403_permission_denied'
handler400 = 'web.views.e400_bad_request'
def index(request): def index(request):
if request.user.is_authenticated(): if request.user.is_authenticated():
return redirect(appointments) return redirect(appointments)
return redirect(login) return redirect(login)
def e404_page_not_found(request):
return render(request, "errors/404.html", context)
def e500_error(request):
return render(request, "errors/500.html", context)
def e403_permission_denied(request):
return render(request, "errors/403.html", context)
def e400_bad_request(request):
return render(request, "errors/400.html", context)
def login(request): def login(request):
context = { context = {
'state' : 'initial' 'state' : 'initial'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment