mirror of https://github.com/django/django.git
Removed some unused and duplicated imports.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8194 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c85c8f8891
commit
2a7f7e1b97
|
@ -1,12 +1,10 @@
|
||||||
import base64
|
import base64
|
||||||
import cPickle as pickle
|
import cPickle as pickle
|
||||||
import datetime
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from django import http, template
|
from django import http, template
|
||||||
from django.contrib.admin import ModelAdmin
|
from django.contrib.admin import ModelAdmin
|
||||||
from django.contrib.auth import authenticate, login
|
from django.contrib.auth import authenticate, login
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
|
||||||
from django.db.models.base import ModelBase
|
from django.db.models.base import ModelBase
|
||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render_to_response
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
|
@ -28,13 +26,11 @@ class NotRegistered(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _encode_post_data(post_data):
|
def _encode_post_data(post_data):
|
||||||
from django.conf import settings
|
|
||||||
pickled = pickle.dumps(post_data)
|
pickled = pickle.dumps(post_data)
|
||||||
pickled_md5 = md5_constructor(pickled + settings.SECRET_KEY).hexdigest()
|
pickled_md5 = md5_constructor(pickled + settings.SECRET_KEY).hexdigest()
|
||||||
return base64.encodestring(pickled + pickled_md5)
|
return base64.encodestring(pickled + pickled_md5)
|
||||||
|
|
||||||
def _decode_post_data(encoded_data):
|
def _decode_post_data(encoded_data):
|
||||||
from django.conf import settings
|
|
||||||
encoded_data = base64.decodestring(encoded_data)
|
encoded_data = base64.decodestring(encoded_data)
|
||||||
pickled, tamper_check = encoded_data[:-32], encoded_data[-32:]
|
pickled, tamper_check = encoded_data[:-32], encoded_data[-32:]
|
||||||
if md5_constructor(pickled + settings.SECRET_KEY).hexdigest() != tamper_check:
|
if md5_constructor(pickled + settings.SECRET_KEY).hexdigest() != tamper_check:
|
||||||
|
@ -205,7 +201,6 @@ class AdminSite(object):
|
||||||
This takes into account the USE_I18N setting. If it's set to False, the
|
This takes into account the USE_I18N setting. If it's set to False, the
|
||||||
generated JavaScript will be leaner and faster.
|
generated JavaScript will be leaner and faster.
|
||||||
"""
|
"""
|
||||||
from django.conf import settings
|
|
||||||
if settings.USE_I18N:
|
if settings.USE_I18N:
|
||||||
from django.views.i18n import javascript_catalog
|
from django.views.i18n import javascript_catalog
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue