forked from hergaiety/FormInputs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit of working code for Weeks 6 and 7
- Loading branch information
Maureen Slavin
committed
Jul 21, 2018
0 parents
commit 631a236
Showing
7 changed files
with
8,515 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from flask import Flask, request, render_template | ||
app = Flask(__name__) | ||
app.config["DEBUG"] = True | ||
|
||
@app.route('/', methods=['GET']) | ||
def main(): | ||
# found in ../templates/ | ||
return render_template("main_page.html") | ||
|
||
@app.route('/process_inputs', methods=['POST']) | ||
def process_inputs(): | ||
name = request.form.get('input_name', '') | ||
dropdown = request.form.get('input_dropdown', '') | ||
select = request.form.get('input_select', '') | ||
freeform = request.form.get('input_freeform', '') | ||
return render_template("main_page.html", input_data=dropdown, | ||
output="You're a wizard %s." % name) | ||
|
||
|
||
if __name__ == '__main__': | ||
app.run() |
Oops, something went wrong.