Document the DOCUMENT_PASSWORD_REQUIRED_TEMPLATE setting

pull/3644/merge
Matt Westcott 2017-06-08 20:41:46 +01:00
rodzic 9336f9c5a3
commit b2fbd91864
4 zmienionych plików z 25 dodań i 3 usunięć

Wyświetl plik

@ -9,7 +9,9 @@ Users with publish permission on a page can set it to be private by clicking the
* **Accessible with the following password:** The user must enter the given password to view the page. This is appropriate for situations where you want to share a page with a trusted group of people, but giving them individual user accounts would be overkill. The same password is shared between all users, and this works independently of any user accounts that exist on the site.
* **Accessible to users in specific groups:** The user must be logged in, and a member of one or more of the specified groups, in order to view the page.
Private pages work on Wagtail out of the box - the site implementer does not need to do anything to set them up. However, the default "log in" and "password required" forms are only bare-bones HTML pages, and site implementers may wish to replace them with a page customised to their site design.
Similarly, documents can be made private by placing them in a collection with appropriate privacy settings (see :ref:`image_document_permissions`).
Private pages and documents work on Wagtail out of the box - the site implementer does not need to do anything to set them up. However, the default "log in" and "password required" forms are only bare-bones HTML pages, and site implementers may wish to replace them with a page customised to their site design.
Setting up a login page
@ -78,6 +80,9 @@ A basic template suitable for use as ``PASSWORD_REQUIRED_TEMPLATE`` might look l
</html>
Password restrictions on documents use a separate template, specified through the setting ``DOCUMENT_PASSWORD_REQUIRED_TEMPLATE``; this template also receives the context variables ``form`` and ``action_url`` as described above.
Setting a "password required" page for a specific page type
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Wyświetl plik

@ -311,8 +311,8 @@ Wagtail update notifications
For admins only, Wagtail performs a check on the dashboard to see if newer releases are available. This also provides the Wagtail team with the hostname of your Wagtail site. If you'd rather not receive update notifications, or if you'd like your site to remain unknown, you can disable it with this setting.
Private Pages
-------------
Private pages / documents
-------------------------
.. code-block:: python
@ -320,6 +320,14 @@ Private Pages
This is the path to the Django template which will be used to display the "password required" form when a user accesses a private page. For more details, see the :ref:`private_pages` documentation.
.. code-block:: python
DOCUMENT_PASSWORD_REQUIRED_TEMPLATE = 'myapp/document_password_required.html'
.. versionadded:: 1.11
As above, but for password restrictions on documents. For more details, see the :ref:`private_pages` documentation.
Case-Insensitive Tags
---------------------

Wyświetl plik

@ -112,6 +112,12 @@ See also: :meth:`wagtail.wagtailcore.models.Page.get_url_parts`, :meth:`wagtail.
:meth:`wagtail.wagtailcore.models.Page.get_full_url`, and :meth:`wagtail.wagtailcore.models.Page.relative_url`
"Password required" template for documents
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This release adds the ability to password-protect documents as well as pages. The template used for the "password required" form is distinct from the one used for pages; if you have previously overridden the default template through the ``PASSWORD_REQUIRED_TEMPLATE`` setting, you may wish to provide a corresponding template for documents through the setting ``DOCUMENT_PASSWORD_REQUIRED_TEMPLATE``. See: :ref:`private_pages`
Elasticsearch 5.4 is incompatible with ``ATOMIC_REBUILD``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Wyświetl plik

@ -33,6 +33,9 @@ The full set of available permission types is as follows:
Drafts can be viewed only if the user has either Edit or Publish permission.
.. _image_document_permissions:
Image / document permissions
----------------------------