SORU
11 EYLÜL 2011, Pazar


Django SECRET_KEY

Tam olarak django SECRET_KEY nokta nedir? Az bir google arama yaptım ve belgeleri kontrol edildi ( https://docs.djangoproject.com/en/dev/ref/settings/#secret-key ), ama neden gereklidir derinlemesine bir açıklama bu, ve bir daha arıyordum.

Örneğin, eğer anahtarı Diğerleri ne olduğunu / tehlikeye girdiyse, ne olabilir ki? Teşekkür ederim.

CEVAP
12 EYLÜL 2011, PAZARTESİ


Karma yapmak için kullanılır. Bak:

>grep -Inr SECRET_KEY *
conf/global_settings.py:255:SECRET_KEY = ''
conf/project_template/settings.py:61:SECRET_KEY = ''
contrib/auth/tokens.py:54:        hash = sha_constructor(settings.SECRET_KEY   unicode(user.id)  
contrib/comments/forms.py:86:        info = (content_type, object_pk, timestamp, settings.SECRET_KEY)
contrib/formtools/utils.py:15:    order, pickles the result with the SECRET_KEY setting, then takes an md5
contrib/formtools/utils.py:32:    data.append(settings.SECRET_KEY)
contrib/messages/storage/cookie.py:112:        SECRET_KEY, modified to make it unique for the present purpose.
contrib/messages/storage/cookie.py:114:        key = 'django.contrib.messages'   settings.SECRET_KEY
contrib/sessions/backends/base.py:89:        pickled_md5 = md5_constructor(pickled   settings.SECRET_KEY).hexdigest()
contrib/sessions/backends/base.py:95:        if md5_constructor(pickled   settings.SECRET_KEY).hexdigest() != tamper_check:
contrib/sessions/backends/base.py:134:        # Use settings.SECRET_KEY as added salt.
contrib/sessions/backends/base.py:143:                       settings.SECRET_KEY)).hexdigest()
contrib/sessions/models.py:16:        pickled_md5 = md5_constructor(pickled   settings.SECRET_KEY).hexdigest()
contrib/sessions/models.py:59:        if md5_constructor(pickled   settings.SECRET_KEY).hexdigest() != tamper_check:
core/management/commands/startproject.py:32:        # Create a random SECRET_KEY hash, and put it in the main settings.
core/management/commands/startproject.py:37:        settings_contents = re.sub(r"(?<=SECRET_KEY = ')'", secret_key   "'", settings_contents)
middleware/csrf.py:38:                % (randrange(0, _MAX_CSRF_KEY), settings.SECRET_KEY)).hexdigest()
middleware/csrf.py:41:    return md5_constructor(settings.SECRET_KEY   session_id).hexdigest()

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • CorridorDigital

    CorridorDigi

    17 Mayıs 2010
  • MatheusDosGames

    MatheusDosGa

    28 Aralık 2011
  • Matt Steffanina

    Matt Steffan

    1 EYLÜL 2011