Skip to content

Commit

Permalink
Merge pull request #2394 from alanhamlett/master
Browse files Browse the repository at this point in the history
Add extra_css and extra_js to advanced docs
  • Loading branch information
alanhamlett authored Oct 15, 2023
2 parents 7836c50 + 9eb7f4b commit 6509ef9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions doc/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Advanced Functionality
Enabling CSRF Protection
------------------------

****

To add CSRF protection to the forms that are generated by *ModelView* instances, use the
SecureForm class in your *ModelView* subclass by specifying the *form_base_class* parameter::

Expand All @@ -18,6 +20,17 @@ SecureForm class in your *ModelView* subclass by specifying the *form_base_class
SecureForm requires WTForms 2 or greater. It uses the WTForms SessionCSRF class
to generate and validate the tokens for you when the forms are submitted.

Adding Custom Javascript and CSS
--------------------------------

****

To add custom JavaScript or CSS in your *ModelView* use *extra_js* or *extra_css* parameters::

class MyModelView(ModelView):
extra_js = ['https://example.com/custom.js']
extra_css = ['https://example.com/custom.css']

Localization With Flask-Babelex
-------------------------------

Expand Down

0 comments on commit 6509ef9

Please sign in to comment.