You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
beaker-blog/src/forms.py

17 lines
420 B

import os
from flask_wtf import CSRFProtect, FlaskForm
from wtforms import StringField, SubmitField, ValidationError, validators
def register_csrf(app):
csrf = CSRFProtect()
SECRET_KEY = os.urandom(32)
app.secret_key = SECRET_KEY
csrf.init_app(app)
class SearchForm(FlaskForm):
query_str = StringField("Query", [validators.DataRequired("Please enter the search term")])
# submit = SubmitField("Search")