Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented #22: Make a proper 404 page. #68

Merged
merged 3 commits into from May 18, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions cbv/static/style.css
Expand Up @@ -117,3 +117,31 @@ footer p {
.nav .nav-header{
padding: 0 15px;
}
.http-error {
text-align: center;
margin-bottom: 3em;
}
.http-error-number {
font-size: 18em;
line-height: 1em;
margin: 0 auto;
width: 400px;
}
.http-error-message {
font-size: 2.5em;
text-align: justify;
line-height: 1.4em;
margin: 0 auto;
width: 400px;
}
@media (max-width: 480px) {
.http-error-number {
margin-top: -30px;
font-size: 9em;
width: 200px;
}
.http-error-message {
font-size: 1.5em;
width: 200px;
}
}
16 changes: 15 additions & 1 deletion cbv/templates/404.html
@@ -1 +1,15 @@
404: File not found.
{% extends "base.html" %}
{% load url from future %}

{% block content %}
<div class="span12">
<div class="http-error">
<h1 class="http-error-number">
404
</h1>
<p class="http-error-message">
The page you are looking for can't be found. Try our <a href="{% url 'home' %}">Homepage</a>.
</p>
</div>
</div>
{% endblock content %}
17 changes: 16 additions & 1 deletion cbv/templates/500.html
@@ -1 +1,16 @@
500: Server error.
{% extends "base.html" %}

{% block content %}
<div class="span12">
<div class="http-error">
<h1 class="http-error-number">
500
</h1>
<p class="http-error-message">
Oops, look like we broke something. We received a notification
and will fix it as soon as possible. In the meantime, you can
go back to our <a href="/">Homepage</a>.
</p>
</div>
</div>
{% endblock content %}
9 changes: 9 additions & 0 deletions inspector/urls.py
Expand Up @@ -2,6 +2,7 @@
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView

from cbv.views import HomeView

Expand All @@ -17,3 +18,11 @@
)

urlpatterns += staticfiles_urlpatterns() + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.DEBUG:
urlpatterns += patterns('',
url(r'^404/', TemplateView.as_view(template_name='404.html')),
url(r'^500/', TemplateView.as_view(template_name='500.html')),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these have a dollar on the end, please? ie r'^500/$'

url(r'^404/$', TemplateView.as_view(template_name='404.html')),
url(r'^500/$', TemplateView.as_view(template_name='500.html')),
)