Skip to content

Instantly share code, notes, and snippets.

View llater's full-sized avatar

Leland Later llater

View GitHub Profile
@llater
llater / gist:6967a886127a3699faa58a673413c351
Created January 12, 2017 22:01 — forked from maximebf/gist:3986583
Add dynamic subdomain support to a Flask app
def add_subdomain_to_global(endpoint, values):
g.subdomain = values.pop('subdomain', None)
def add_subdomain_to_url_params(endpoint, values):
if not 'subdomain' in values:
values['subdomain'] = g.subdomain
def add_subdomain_support(app):
app.url_value_preprocessor(add_subdomain_to_global)
app.url_defaults(add_subdomain_to_url_params)
# VERSION 1.0.4
# Author: @madhavajay
# This currently works for iOS and watchOS in the Simulator and Devices
# Changes
# Using ${TOOLCHAIN} in two places now
# Added double quotes " around paths
# Fixed watchOS Issues
# Instructions iOS