To complement Sean Viera's post, you also need to set the SERVER_NAME config variable.
Documentation: http://flask.pocoo.org/docs/config/#SERVER_NAME
The name and port number of the server. Required for subdomain support
(e.g.: 'myapp.dev:5000') Note that localhost does not support
subdomains so setting this to “localhost” does not help. Setting a
SERVER_NAME also by default enables URL generation without a request
context but with an application context.
To test locally you need to add entries to your hosts
file, like this:
127.0.0.1 cvshark.local
127.0.0.1 robert.cvshark.local
127.0.0.1 www.cvshark.local