mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
BACKWARDS-INCOMPATIBLE CHANGE -- Moved flatpages and redirects to standalone apps in django.contrib that are NOT installed by default. See http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges for full migration information.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1166 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
from django.conf import settings
|
||||
from django.core import exceptions
|
||||
from django.utils import httpwrappers
|
||||
from django.core.mail import mail_managers
|
||||
from django.views.core.flatfiles import flat_file
|
||||
import md5, os
|
||||
|
||||
class CommonMiddleware:
|
||||
@@ -17,9 +15,6 @@ class CommonMiddleware:
|
||||
- ETags: If the USE_ETAGS setting is set, ETags will be calculated from
|
||||
the entire page content and Not Modified responses will be returned
|
||||
appropriately.
|
||||
|
||||
- Flat files: For 404 responses, a flat file matching the given path
|
||||
will be looked up and used if found.
|
||||
"""
|
||||
|
||||
def process_request(self, request):
|
||||
@@ -55,12 +50,6 @@ class CommonMiddleware:
|
||||
def process_response(self, request, response):
|
||||
"Check for a flat page (for 404s) and calculate the Etag, if needed."
|
||||
if response.status_code == 404:
|
||||
if settings.USE_FLAT_PAGES:
|
||||
try:
|
||||
return flat_file(request, request.path)
|
||||
except exceptions.Http404:
|
||||
pass
|
||||
|
||||
if settings.SEND_BROKEN_LINK_EMAILS:
|
||||
# If the referrer was from an internal link or a non-search-engine site,
|
||||
# send a note to the managers.
|
||||
|
||||
Reference in New Issue
Block a user