Makes notes for settings module more visible (#2826)

pull/2825/merge
Mikalai Radchuk 2016-07-06 19:01:09 +03:00 zatwierdzone przez GitHub
rodzic b79069b247
commit 0b29ba80db
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -118,7 +118,7 @@ Then access the settings through ``{{ settings }}``:
{{ settings.app_label.SocialMediaSettings.instagram }}
(Replace ``app_label`` with the label of the app containing your settings model.)
.. note:: Replace ``app_label`` with the label of the app containing your settings model.
If you are not in a ``RequestContext``, then context processors will not have run, and the ``settings`` variable will not be availble. To get the ``settings``, use the provided ``{% get_settings %}`` template tag. If a ``request`` is in the template context, but for some reason it is not a ``RequestContext``, just use ``{% get_settings %}``:
@ -168,7 +168,7 @@ Then access the settings through the ``settings()`` template function:
{{ settings("app_label.SocialMediaSettings").twitter }}
(Replace ``app_label`` with the label of the app containing your settings model.)
.. note:: Replace ``app_label`` with the label of the app containing your settings model.
This will look for a ``request`` variable in the template context, and find the correct site to use from that. If for some reason you do not have a ``request`` available, you can instead use the settings defined for the default site: