Skip to content

Instantly share code, notes, and snippets.

@carc1n0gen
Last active February 22, 2021 09:05
Show Gist options
  • Save carc1n0gen/edbd536a6e5394ca04dd7c88158f5824 to your computer and use it in GitHub Desktop.
Save carc1n0gen/edbd536a6e5394ca04dd7c88158f5824 to your computer and use it in GitHub Desktop.
Flask Host Matching
from flask import Flask, url_for
app = Flask(__name__, host_matching=True, static_host='app1.local:5000')
@app.route('/', host='app1.local:5000')
def home1():
return url_for('home1')
@app.route('/', host='app2.local:5000')
def home2():
return url_for('home2')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment