Skip to content

Commit

Permalink
[1.6.x] Added some doc links for django.contrib.messages
Browse files Browse the repository at this point in the history
Backport of b6178fa from master
  • Loading branch information
timgraham committed Aug 14, 2013
1 parent b720ece commit 8bd5251
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 7 additions & 4 deletions docs/ref/contrib/messages.txt
Expand Up @@ -54,20 +54,21 @@ Storage backends


The messages framework can use different backends to store temporary messages. The messages framework can use different backends to store temporary messages.


Django provides three built-in storage classes: Django provides three built-in storage classes in
:mod:`django.contrib.messages`:


.. class:: django.contrib.messages.storage.session.SessionStorage .. class:: storage.session.SessionStorage


This class stores all messages inside of the request's session. Therefore This class stores all messages inside of the request's session. Therefore
it requires Django's ``contrib.sessions`` application. it requires Django's ``contrib.sessions`` application.


.. class:: django.contrib.messages.storage.cookie.CookieStorage .. class:: storage.cookie.CookieStorage


This class stores the message data in a cookie (signed with a secret hash This class stores the message data in a cookie (signed with a secret hash
to prevent manipulation) to persist notifications across requests. Old to prevent manipulation) to persist notifications across requests. Old
messages are dropped if the cookie data size would exceed 2048 bytes. messages are dropped if the cookie data size would exceed 2048 bytes.


.. class:: django.contrib.messages.storage.fallback.FallbackStorage .. class:: storage.fallback.FallbackStorage


This class first uses ``CookieStorage``, and falls back to using This class first uses ``CookieStorage``, and falls back to using
``SessionStorage`` for the messages that could not fit in a single cookie. ``SessionStorage`` for the messages that could not fit in a single cookie.
Expand All @@ -83,6 +84,8 @@ path, for example::


MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage' MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage'


.. class:: storage.base.BaseStorage

To write your own storage class, subclass the ``BaseStorage`` class in To write your own storage class, subclass the ``BaseStorage`` class in
``django.contrib.messages.storage.base`` and implement the ``_get`` and ``django.contrib.messages.storage.base`` and implement the ``_get`` and
``_store`` methods. ``_store`` methods.
Expand Down
4 changes: 3 additions & 1 deletion docs/ref/settings.txt
Expand Up @@ -2241,7 +2241,9 @@ Controls where Django stores message data. Valid values are:


See :ref:`message storage backends <message-storage-backends>` for more details. See :ref:`message storage backends <message-storage-backends>` for more details.


The backends that use cookies -- ``CookieStorage`` and ``FallbackStorage`` -- The backends that use cookies --
:class:`~django.contrib.messages.storage.cookie.CookieStorage` and
:class:`~django.contrib.messages.storage.fallback.FallbackStorage` --
use the value of :setting:`SESSION_COOKIE_DOMAIN` when setting their cookies. use the value of :setting:`SESSION_COOKIE_DOMAIN` when setting their cookies.


.. setting:: MESSAGE_TAGS .. setting:: MESSAGE_TAGS
Expand Down

0 comments on commit 8bd5251

Please sign in to comment.