Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,21 @@ changed in your own ``settings.py``:

**Default:** ``'flavour'``

``FLAVOURS_COOKIE_AGE``
The maximum age of the flavour cookie, in seconds, or None if the cookie
should expire at the end of the browser session. This is only used if
``FLAVOURS_STORAGE_BACKEND`` is set to ``'cookie'``.

**Default:** ``None``

``FLAVOURS_COOKIE_DOMAIN``
The domain to use for the flavour cookie. Set this to a string such as
``".example.com"`` for cross-domain cookies, or use ``None`` for a
standard domain cookie. This is only used if ``FLAVOURS_STORAGE_BACKEND``
is set to ``'cookie'``.

**Default:** ``None``

``FLAVOURS_TEMPLATE_PREFIX``
This string will be prefixed to the template names when searching for
flavoured templates. This is useful if you have many flavours and want to
Expand Down
2 changes: 2 additions & 0 deletions django_mobile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def save(self, request, response):
response.set_cookie(
smart_str(settings.FLAVOURS_COOKIE_KEY),
smart_str(request._flavour_cookie),
max_age=settings.FLAVOURS_COOKIE_AGE,
domain=settings.FLAVOURS_COOKIE_DOMAIN,
httponly=settings.FLAVOURS_COOKIE_HTTPONLY)


Expand Down
2 changes: 2 additions & 0 deletions django_mobile/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class defaults(object):
FLAVOURS_GET_PARAMETER = u'flavour'
FLAVOURS_STORAGE_BACKEND = u'cookie'
FLAVOURS_COOKIE_KEY = u'flavour'
FLAVOURS_COOKIE_AGE = None
FLAVOURS_COOKIE_DOMAIN = None
FLAVOURS_COOKIE_HTTPONLY = False
FLAVOURS_SESSION_KEY = u'flavour'
FLAVOURS_TEMPLATE_LOADERS = []
Expand Down