浏览代码

Add documentation to support password required settings change

PASSWORD_REQUIRED_TEMPLATE -> WAGTAIL_PASSWORD_REQUIRED_TEMPLATE
DOCUMENT_PASSWORD_REQUIRED_TEMPLATE -> WAGTAILDOCS_PASSWORD_REQUIRED_TEMPLATE
Saksham Misra 1 年之前
父节点
当前提交
53d6ea4491

+ 2 - 2
docs/advanced_topics/documents/storing_and_serving.md

@@ -51,10 +51,10 @@ WAGTAILDOCS_EXTENSIONS = ['pdf', 'docx']
 
 ## Document password required template
 
-Wagtail provides the `DOCUMENT_PASSWORD_REQUIRED_TEMPLATE` setting to use a custom template when a password is required to access a protected document. Read more about [](private_pages).
+Wagtail provides the `WAGTAILDOCS_PASSWORD_REQUIRED_TEMPLATE` setting to use a custom template when a password is required to access a protected document. Read more about [](private_pages).
 
 Here's an example:
 
 ```python
-DOCUMENT_PASSWORD_REQUIRED_TEMPLATE = 'myapp/document_password_required.html'
+WAGTAILDOCS_PASSWORD_REQUIRED_TEMPLATE = 'myapp/document_password_required.html'
 ```

+ 4 - 4
docs/advanced_topics/privacy.md

@@ -74,10 +74,10 @@ To integrate Wagtail into a Django site with an existing login mechanism, settin
 
 ## Setting up a global "password required" page
 
-By setting `PASSWORD_REQUIRED_TEMPLATE` in your Django settings file, you can specify the path of a template which will be used for all "password required" forms on the site (except for page types that specifically override it - see below):
+By setting `WAGTAIL_PASSWORD_REQUIRED_TEMPLATE` in your Django settings file, you can specify the path of a template which will be used for all "password required" forms on the site (except for page types that specifically override it - see below):
 
 ```python
-PASSWORD_REQUIRED_TEMPLATE = 'myapp/password_required.html'
+WAGTAIL_PASSWORD_REQUIRED_TEMPLATE = 'myapp/password_required.html'
 ```
 
 This template will receive the same set of context variables that the blocked page would pass to its own template via `get_context()` - including `page` to refer to the page object itself - plus the following additional variables (which override any of the page's own context variables of the same name):
@@ -85,7 +85,7 @@ This template will receive the same set of context variables that the blocked pa
 -   **form** - A Django form object for the password prompt; this will contain a field named `password` as its only visible field. Several hidden fields may also be present, so the page must loop over `form.hidden_fields` if not using one of Django's rendering helpers such as `form.as_p`.
 -   **action_url** - The URL that the password form should be submitted to, as a POST request.
 
-A basic template suitable for use as `PASSWORD_REQUIRED_TEMPLATE` might look like this:
+A basic template suitable for use as `WAGTAIL_PASSWORD_REQUIRED_TEMPLATE` might look like this:
 
 ```html+django
 <!DOCTYPE HTML>
@@ -119,7 +119,7 @@ A basic template suitable for use as `PASSWORD_REQUIRED_TEMPLATE` might look lik
 </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.
+Password restrictions on documents use a separate template, specified through the setting `WAGTAILDOCS_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
 

+ 3 - 3
docs/reference/pages/model_reference.md

@@ -185,9 +185,9 @@ See also [django-treebeard](https://django-treebeard.readthedocs.io/en/latest/in
     .. automethod:: route
 
     .. automethod:: serve
-    
+
     .. automethod:: route_for_request
-    
+
     .. automethod:: find_for_request
 
     .. autoattribute:: context_object_name
@@ -311,7 +311,7 @@ See also [django-treebeard](https://django-treebeard.readthedocs.io/en/latest/in
 
     .. attribute:: password_required_template
 
-        Defines which template file should be used to render the login form for Protected pages using this model. This overrides the default, defined using ``PASSWORD_REQUIRED_TEMPLATE`` in your settings. See :ref:`private_pages`
+        Defines which template file should be used to render the login form for Protected pages using this model. This overrides the default, defined using ``WAGTAIL_PASSWORD_REQUIRED_TEMPLATE`` in your settings. See :ref:`private_pages`
 
     .. attribute:: is_creatable
 

+ 14 - 4
docs/reference/settings.md

@@ -644,24 +644,34 @@ WAGTAIL_ENABLE_WHATS_NEW_BANNER = True
 
 For new releases, Wagtail may show a notification banner on the dashboard that helps users learn more about the UI changes and new features in the release. Users can dismiss this banner, which will hide it until the next release. If you'd rather not show these banners, you can disable it with this setting.
 
+(frontend_authentication)=
+
 ## Frontend authentication
 
-### `PASSWORD_REQUIRED_TEMPLATE`
+### `WAGTAIL_PASSWORD_REQUIRED_TEMPLATE`
 
 ```python
-PASSWORD_REQUIRED_TEMPLATE = 'myapp/password_required.html'
+WAGTAIL_PASSWORD_REQUIRED_TEMPLATE = 'myapp/password_required.html'
 ```
 
 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 [](private_pages) documentation.
 
-### `DOCUMENT_PASSWORD_REQUIRED_TEMPLATE`
+```{versionchanged} 6.1
+`PASSWORD_REQUIRED_TEMPLATE` has been deprecated and renamed to `WAGTAIL_PASSWORD_REQUIRED_TEMPLATE`.
+```
+
+### `WAGTAILDOCS_PASSWORD_REQUIRED_TEMPLATE`
 
 ```python
-DOCUMENT_PASSWORD_REQUIRED_TEMPLATE = 'myapp/document_password_required.html'
+WAGTAILDOCS_PASSWORD_REQUIRED_TEMPLATE = 'myapp/document_password_required.html'
 ```
 
 As above, but for password restrictions on documents. For more details, see the [](private_pages) documentation.
 
+```{versionchanged} 6.1
+`DOCUMENT_PASSWORD_REQUIRED_TEMPLATE` has been deprecated and renamed to `WAGTAILDOCS_PASSWORD_REQUIRED_TEMPLATE`.
+```
+
 ### `WAGTAIL_FRONTEND_LOGIN_TEMPLATE`
 
 The basic login page can be customized with a custom template.