This demonstrates how to run a local development server which uses a different configuration based on the subdomain of the request. It creates a separate instance of the app per subdomain. See here for more information: http://flask.pocoo.org/docs/patterns/appdispatch/#dispatch-by-subdomain
-
Add the following to your hosts file (/etc/hosts on Ubuntu):
0.0.0.0 dev.localhost 0.0.0.0 qa.localhost
-
Install Flask
virtualenv venv source venv/bin/activate pip install Flask==0.10.1
-
Run the local development server
python subdomainexample.py
-
Visit the following URLs in the browser: