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.

21 lines
523 B

3 years ago
from flask import Flask, render_template
from flask_wtf import FlaskForm
3 years ago
from flask_wtf.csrf import CSRFProtect
from flask_wtf.file import FileField, FileRequired
3 years ago
from wtforms import StringField
from wtforms.validators import DataRequired
app = Flask(__name__)
3 years ago
app.config["SECRET_KEY"] = "foo"
app.config["WTF_CSRF_SECRET_KEY"] = "bar"
3 years ago
3 years ago
3 years ago
class UploadForm(FlaskForm):
pdf = FileField(validators=[FileRequired()])
3 years ago
3 years ago
3 years ago
@app.route("/")
def home():
form = UploadForm()
return render_template("index.html", form=form)