Skip to content

Instantly share code, notes, and snippets.

@qaisjp

qaisjp/app.py

Created Dec 28, 2019
Embed
What would you like to do?
simple flask app for password redirects
from flask import Flask, redirect
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Page with password form!'
urls = {
"googlepass": "https://google.com",
"youtubepass": "https://youtube.com"
}
@app.route('/go', methods=['POST'])
def go():
password = request.form.get("password", "")
url = urls.get(password, "/404")
return redirect(url)
@app.route("/404")
def oops():
return "Wrong password"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.