diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/main.py b/main.py new file mode 100644 index 0000000..2a74573 --- /dev/null +++ b/main.py @@ -0,0 +1,29 @@ +from flask import Flask, flash, redirect, render_template, request, session, abort + +app = Flask(__name__) + +@app.route("/") +def index(): + return "Index!" + +@app.route("/hello") +def hello(): + return "Hello World!" + +@app.route("/form") +def form(): + return render_template( + 'form.html',**locals()) + +@app.route('/form_post', methods = ['POST']) +def form_post(): + if request.method == 'POST': + data = request.form + print("data: {}".format(data)) + # TODO: save this data to a csv + # deploy this python app to server somewhere + # with a particular domain + return "form submitted" + +if __name__ == "__main__": + app.run() \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0c8d93e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +click==8.0.4 +Flask==2.0.3 +itsdangerous==2.1.1 +Jinja2==3.0.3 +MarkupSafe==2.1.0 +Werkzeug==2.0.3 diff --git a/templates/form.html b/templates/form.html new file mode 100644 index 0000000..0293057 --- /dev/null +++ b/templates/form.html @@ -0,0 +1,12 @@ +
+ here is the simple web form, lets see how this works +
+ +
+
+
+
+

+ +
+
\ No newline at end of file