From cc95d23e738774af7afa0eb3fc146b0a143b77ce Mon Sep 17 00:00:00 2001 From: simoon Date: Mon, 6 Dec 2021 10:18:50 +0100 Subject: [PATCH] new files --- .gitignore | 1 + Makefile | 4 ++++ __pycache__/app.cpython-39.pyc | Bin 0 -> 973 bytes app.py | 19 +++++++++++++++++++ templates/index.html | 15 +++++++++++++++ 5 files changed, 39 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 __pycache__/app.cpython-39.pyc create mode 100644 app.py create mode 100644 templates/index.html 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 0000000000000000000000000000000000000000..1ffecde72714f136d15c02b62357d527f0d2fe45 GIT binary patch literal 973 zcmZuvy>1gh5Z>MU@%j9l&>%!Z=^{CxMhFRTsu+ZWkhVEpJnQ7}p3m7m6B32WY5fjR zrr>dCwx!|~QZaK55CnVLxtX2anfbn%tka1Zt~=kpW=t^los8SdN8=f8dw~KNaLo!X zc_F0WWDD&TzVvI|(?Jo+u-1LuC?XkgrnqXZxQtc&xdp)&4k0uy8J@KF7(~##WYARp z%99-xzi&YdEodJJ=&S{Fp;zDRLVwH#TR*S@HV`ft>deku&!{;llUAx&=&Vu$?wYk{ zSegQj*0?hH{Aidf4QRGsWL5S?oh);s;F>2BiuP-9R0!#F-1Z)d3Xy`yIe2USiB%l@ z3kJbjU>)H|`V(uWLk#K{s>-h891Holdt4Rz3eTpLU$}7pj4Cl6hBHL+6*C?DT@RDD zRvDYvyeQ{~raYaiWEQA0_+Q44t~1sVX68rOC|MPMrbK>|~2Yf_ryy=32)} z>oPqpjfMyVTSCA@mzy5`|H4O(-<`aVhGLQflR|mGk$rZAXxBmp;2}cawDF4b=UIWQ z%J@U3bI7XF*wG+#QJRt?OORPA;@J8p+csZFU zYaf^<-k{l8;7nATp8TgO7jE)Xyc;^Pw7Y1H20a%{Y48kXts}^0eUP43Q$y^^25Q)H zTjQ78H`eYS{x+O!;a%rp7hPb=Wu@wV)dbY3ZZTDtNOZaA$%g8uG^%zRMW46n6Oo8` J?DxGs{|RTk+H3#- literal 0 HcmV?d00001 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 @@ + + + + + + THIS IS A TITLE + + +
+ {{ form.csrf_token }} + {{ form.name.label }} {{ form.name(size=20) }} + +
+ + \ No newline at end of file