tweaks to 404 page and caching

This commit is contained in:
James Long 2012-02-22 12:28:31 -05:00
Родитель 26032ee99b
Коммит a5a2391a07
2 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -5,7 +5,10 @@ from time import mktime
class CacheMiddleware(object):
def process_response(self, request, response):
if response.status_code != 404 and 'Cache-Control' not in response:
cache = (request.method != 'POST' and
response.status_code != 404 and
'Cache-Control' not in response)
if cache:
d = datetime.datetime.now() + datetime.timedelta(minutes=10)
stamp = mktime(d.timetuple())

Просмотреть файл

@ -1 +1,8 @@
Page Not Found - mozilla.org
{% extends "base.html" %}
{% block content %}
<div id="main-content">
<h1>Whoops!</h1>
We apologize, but this page cannot be found.
</div>
{% endblock %}