Commit dfb00088 authored by Jean Michel Rouly's avatar Jean Michel Rouly
Browse files

Added 404 and 500 error pages.

parent 09db6f1a
......@@ -10,6 +10,9 @@ from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
admin.autodiscover()
handle404 = "error_404"
handle500 = "error_500"
urlpatterns = patterns('website.views',
# Examples:
# url(r'^$', 'bookshare.views.home', name='home'),
......
<!DOCTYPE html>
<html>
<title>404</title>
<style>
body {
text-align: center;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
height: 100%;
}
.container {
margin: auto;
}
h1 {
font-family: "Helvetica Neue", "Helvetica", sans-serif;
margin-top: ;
}
#squirrels {
width: 100%;
}
#acorn {
width: 52px;
position: fixed;
bottom: 10px;
right: 10px;
}
</style>
</head>
<body>
<div class="container">
<h1>404 Error - Page Not Found</h1>
<img id="squirrels" src="/static/img/squirrels.png">
</div>
<a href="/"><img id="acorn" src="/static/img/acorn.png"></a>
</body>
</html>
<!DOCTYPE html>
<html>
<title>500 Server Error</title>
<style>
body {
text-align: center;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
height: 100%;
}
.container {
margin: auto;
}
h1 {
font-family: "Helvetica Neue", "Helvetica", sans-serif;
margin-top: ;
}
#squirrels {
width: 100%;
}
#acorn {
width: 52px;
position: fixed;
bottom: 10px;
right: 10px;
}
</style>
</head>
<body>
<div class="container">
<h1>500 Error - Internal Server Error</h1>
<img id="squirrels" src="/static/img/squirrels.png">
</div>
<a href="/"><img id="acorn" src="/static/img/acorn.png"></a>
</body>
</html>
......@@ -58,7 +58,17 @@ def ratingsAverage(seller):
############# VIEWS #######################
def error_404(request):
# merely forms
return render(request, '404.html', {
},
)
def error_500(request):
# merely forms
return render(request, '500.html', {
},
)
# home page
# Maybe don't login_require this, and allow anonymous users to browse a
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment