Copywriting
This commit is contained in:
parent
3d2e637d57
commit
b3e757af88
6
main.py
6
main.py
|
@ -11,7 +11,7 @@ if not os.path.exists(DATA_DIR):
|
||||||
os.mkdir(DATA_DIR)
|
os.mkdir(DATA_DIR)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/index")
|
||||||
def index():
|
def index():
|
||||||
return "Index!"
|
return "Index!"
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ def hello():
|
||||||
return "Hello World!"
|
return "Hello World!"
|
||||||
|
|
||||||
|
|
||||||
@app.route("/form")
|
@app.route("/")
|
||||||
def form():
|
def form():
|
||||||
return render_template(
|
return render_template(
|
||||||
'form.html',**locals())
|
'form.html',**locals())
|
||||||
|
@ -36,7 +36,7 @@ def form_post():
|
||||||
file_path = os.path.join(DATA_DIR, filename)
|
file_path = os.path.join(DATA_DIR, filename)
|
||||||
with open(file_path, 'w') as f:
|
with open(file_path, 'w') as f:
|
||||||
f.write(json.dumps(data))
|
f.write(json.dumps(data))
|
||||||
return "form submitted"
|
return "your form submission was saved, thank you"
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue