@app.route('/', subdomain='static')
def static_index():
    """Flask supports static subdomains
    This is available at static.your-domain.tld"""
return 'static.your-domain.tld'
Dynamic Subdomain Handling in a Web App (Flask)