-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.py
More file actions
24 lines (22 loc) · 799 Bytes
/
Copy pathhello.py
File metadata and controls
24 lines (22 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import json
import requests
from flask import (
Flask, Blueprint, flash, g, redirect, render_template, request, url_for
)
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def checkout():
if request.method == 'GET':
return render_template("checkout.html")
else:
if request.method == 'POST':
street = request.form['street_address']
city = request.form['city']
state = request.form['state']
postcode = request.form['postcode']
address = street + ", " + city + ", " + state + " " + postcode
address = address.replace(" ", "+")
website = "https://www.google.com/maps/place/"
website += address
print(website)
return redirect(url_for('/'))