havan / spastik
Spastik is a simple pastebin application written using Django and Pygments. It's purpose was to learn Django.
| commit 63: | 272f0ae62063 |
| parent 62: | 3f77c70d313e |
| branch: | default |
add 404, no time for beautiful error pages
13 months ago
Changed (Δ474 bytes):
raw changeset »
settings.py (1 lines added, 1 lines removed)
static/error.css (19 lines added, 0 lines removed)
templates/404.html (12 lines added, 3 lines removed)
templates/base.html (2 lines added, 0 lines removed)
templates/paste.html (0 lines added, 2 lines removed)
2 |
2 |
|
3 |
3 |
import os.path |
4 |
4 |
|
5 |
DEBUG = |
|
5 |
DEBUG = False |
|
6 |
6 |
TEMPLATE_DEBUG = DEBUG |
7 |
7 |
|
8 |
8 |
ADMINS = ( |
Up to file-list static/error.css:
1 |
body{ |
|
2 |
background-color: silver; |
|
3 |
margin: 0px auto; |
|
4 |
width: 600px; |
|
5 |
text-align: center; |
|
6 |
} |
|
7 |
||
8 |
a { |
|
9 |
color: blue; |
|
10 |
} |
|
11 |
||
12 |
a:hover { |
|
13 |
color: white; |
|
14 |
} |
|
15 |
||
16 |
#error { |
|
17 |
font-size: 16px; |
|
18 |
font-weight: bold; |
|
19 |
} |
Up to file-list templates/404.html:
1 |
{% extends " |
|
1 |
{% extends "base.html" %} |
|
2 |
||
3 |
{% block extracss %} |
|
4 |
@import url('/paste/static/error.css'); |
|
5 |
{% endblock %} |
|
2 |
6 |
|
3 |
7 |
{% block error %} |
4 |
8 |
|
5 |
<div id="404error">404: Aradığınız sayfa bulunamadı</div> |
|
6 |
||
9 |
<div id="error">404: Aradığınız sayfa bulunamadı |
|
10 |
<br> |
|
11 |
<a href="http://www.sudrap.org/paste/text/">Ana Sayfaya Dön!</a> |
|
12 |
</div> |
|
13 |
{% endblock %} |
|
14 |
{% block container %} |
|
7 |
15 |
{% endblock %} |
8 |
16 |
|
17 |
