havan / spastik

Spastik is a simple pastebin application written using Django and Pygments. It's purpose was to learn Django.

Clone this repository (size: 65.4 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/havan/spastik/
commit 63: 272f0ae62063
parent 62: 3f77c70d313e
branch: default
add 404, no time for beautiful error pages
ha...@galactica
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)

Up to file-list settings.py:

2
2
3
3
import os.path
4
4
5
DEBUG = True
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 "paste.html" %}
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

Up to file-list templates/base.html:

@@ -18,6 +18,8 @@ and open the template in the editor.
18
18
    </head>
19
19
    <body>
20
20
21
        {% block error %}{% endblock %}
22
21
23
        {% block container %} No Content! {% endblock %}
22
24
23
25
    </body>

Up to file-list templates/paste.html:

4
4
@import url('/paste/static/paste.css');
5
5
{% endblock %}
6
6
7
{% block error %}{% endblock %}
8
9
7
{% block container %}
10
8
11
9
<form action="/paste/text/" method="POST">