mirror of
https://github.com/wassname/flask-security.git
synced 2026-09-11 12:11:25 +08:00
Paths for templates are now configurable
This commit is contained in:
@@ -96,6 +96,35 @@ URLs and Views
|
||||
=============================== ================================================
|
||||
|
||||
|
||||
Template Paths
|
||||
--------------
|
||||
|
||||
.. tabularcolumns:: |p{6.5cm}|p{8.5cm}|
|
||||
|
||||
======================================== =======================================
|
||||
``SECURITY_FORGOT_PASSWORD_TEMPLATE`` Specifies the path to the template for
|
||||
the forgot password page. Defaults to
|
||||
``security/forgot_password.html``.
|
||||
``SECURITY_LOGIN_USER_TEMPLATE`` Specifies the path to the template for
|
||||
the user login page. Defaults to
|
||||
``security/login_user.html``.
|
||||
``SECURITY_REGISTER_USER_TEMPLATE`` Specifies the path to the template for
|
||||
the user registration page. Defaults to
|
||||
``security/register_user.html``.
|
||||
``SECURITY_RESET_PASSWORD_TEMPLATE`` Specifies the path to the template for
|
||||
the reset password page. Defaults to
|
||||
``security/reset_password.html``.
|
||||
``SECURITY_SEND_CONFIRMATION_TEMPLATE`` Specifies the path to the template for
|
||||
the resend confirmation instructions
|
||||
page. Defaults to
|
||||
``security/send_confirmation.html``.
|
||||
``SECURITY_SEND_LOGIN_TEMPLATE`` Specifies the path to the template for
|
||||
the send login instructions page for
|
||||
passwordless logins. Defaults to
|
||||
``security/send_login.html``.
|
||||
======================================== =======================================
|
||||
|
||||
|
||||
Feature Flags
|
||||
-------------
|
||||
|
||||
|
||||
@@ -26,9 +26,11 @@ Overriding these templates is simple:
|
||||
1. Create a folder named ``security`` within your application's templates folder
|
||||
2. Create a template with the same name for the template you wish to override
|
||||
|
||||
You can also specify custom template file paths in the :doc:`configuration <configuration>`.
|
||||
|
||||
Each template is passed a template context object that includes the following,
|
||||
including the objects/values that are passed to the template by the main
|
||||
Flask application context processory:
|
||||
Flask application context processor:
|
||||
|
||||
* ``<template_name>_form``: A form object for the view
|
||||
* ``security``: The Flask-Security extension object
|
||||
|
||||
Reference in New Issue
Block a user