How to create dynamic subdomains in a Flask application
问题 I am trying to setup variable route handling in a Flask application such as described in this answer: Dynamic Subdomain Handling in a Web App (Flask) However, I want to be able to recognize certain subdomains BEFORE they are caught by the variable route so I can use the flask-restful api extension (Routing with RESTful). For example, I have tried the following: @app.route('/', subdomain="<user>", defaults={'path':''}) @app.route('/<path:path>', subdomain="<user>") def user_profile(user,path):