Added custom 404 & 500 error templates
This commit is contained in:
parent
95fe6a55d0
commit
d2e0fb1f4e
|
@ -0,0 +1,12 @@
|
|||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="well">
|
||||
<h1>404 - Not found!</h1>
|
||||
<p>
|
||||
The content you're looking for wasn't found. This may be a broken link,
|
||||
an upcoming update or a routing error.<br />
|
||||
Wathever that is, rest assured, we've been notified.
|
||||
</p>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -0,0 +1,13 @@
|
|||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="well">
|
||||
<h1>Server error!</h1>
|
||||
<p>
|
||||
Uh oh... something went really wrong. But don't worry! This is most probably
|
||||
our fault. Somewhere in the world someone just received an email with this
|
||||
problem and is on his way to solve it.<br />
|
||||
Sorry for any inconvenience, but remember, this is an alpha!
|
||||
</p>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -50,3 +50,13 @@ def version(request, version, status='release'):
|
|||
def about(request):
|
||||
context = RequestContext(request, {'section': 'about'})
|
||||
return render_to_response('about.html', context_instance=context)
|
||||
|
||||
|
||||
def error404(request):
|
||||
context = RequestContext(request)
|
||||
return render_to_response('errors/404.html', context_instance=context)
|
||||
|
||||
|
||||
def error500(request):
|
||||
context = RequestContext(request)
|
||||
return render_to_response('errors/500.html', context_instance=context)
|
||||
|
|
|
@ -5,6 +5,10 @@ from django.http import HttpResponse, HttpResponseRedirect
|
|||
from django.contrib import admin
|
||||
admin.autodiscover()
|
||||
|
||||
# Custom views
|
||||
handler404 = 'database.views.error404'
|
||||
handler500 = 'database.views.error500'
|
||||
|
||||
urlpatterns = patterns('',
|
||||
# Examples:
|
||||
# url(r'^$', 'herobrine.views.home', name='home'),
|
||||
|
|
Loading…
Reference in New Issue