%global _empty_manifest_terminate_build 0 Name: python-Flask-Modals Version: 0.5.1 Release: 1 Summary: Use forms in Bootstrap modals with Flask. License: MIT License URL: https://github.com/deb17/flask-modals Source0: https://mirrors.aliyun.com/pypi/web/packages/29/74/6d930d8bc8b22e896114f40834a2163685e5f68b7751bf4861ccd1263008/Flask-Modals-0.5.1.tar.gz BuildArch: noarch Requires: python3-Flask %description ## Modals for Flask Use forms in Bootstrap modals with Flask. ### Description Plain forms can be boring. Using them in modals is possible, but requires JavaScript. Normal form submission in modals is problematic. This Flask extension eases the process of using forms in Bootstrap modals. Bootstrap versions 4 and 5 are supported. No JavaScript coding is required on your part. You can code in pure Python - flashing messages and rendering templates. ### Installation ```Shell pip install Flask-Modals ``` ### Setup 1. Import the `Modal` class and instantiate it in your `app.py` file. ```Python from flask_modals import Modal app = Flask(__name__) modal = Modal(app) ``` You will also need a secret key in the app config (not shown).
2. Alternatively if you are using the application factory pattern: ```Python from flask_modals import Modal modal = Modal() def create_app(): app = Flask(__name__) modal.init_app(app) ```
3. Include the following in the head tag of your base template. ```html {{ modals() }} ```
4. Include the following in the modal body. ```html