diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ceb386 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fdf5c9d --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +default: run + +run: + FLASK_APP=app flask run \ No newline at end of file diff --git a/__pycache__/app.cpython-39.pyc b/__pycache__/app.cpython-39.pyc new file mode 100644 index 0000000..1ffecde Binary files /dev/null and b/__pycache__/app.cpython-39.pyc differ diff --git a/app.py b/app.py new file mode 100644 index 0000000..32e5c81 --- /dev/null +++ b/app.py @@ -0,0 +1,19 @@ +from flask import Flask, render_template +from flask_wtf import FlaskForm +from wtforms import StringField +from wtforms.validators import DataRequired + +app = Flask(__name__) + +@app.route("/") +def hello_world(): + form = MyForm(meta={'csrf': False}) + return render_template('index.html', form=form) + +class MyForm(FlaskForm): + name = StringField('name', validators=[DataRequired()]) + +@app.route('/submit', methods=['GET', 'POST']) +def submit(): + print ("Success!") + return render_template('index.html') diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..47cb5e4 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,15 @@ + + +
+ + +