Routes With Custom Domains Using Flask Routes With Custom Domains Using Flask flask flask

Routes With Custom Domains Using Flask


I'm not sure that's possible. host matching and subdomain matching are mutually exclusive (look at host matching parameter).

I'd love to be wrong though.

One way around this issue that I can think of is to use something in front of Flask (say nginx) that points custom.com to custom.com._custom.example.com or something like that. In your code you could create a custom url_for function that would recognize this as a custom domain. I would ask on the Flask mailing list as they would be able to give you a solid answer.