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