I have a Heroku application that has a domain
OSError: [Errno 99] Cannot assign requested address
You can't control this via your code, but you can control this via Heroku.
Heroku has a pretty nifty DNS CNAME tool you can use to ensure your app ONLY listens to incoming requests for specific domains -- it's part of the core Heroku platform.
What you do is this:
heroku domains:add www.moarcatz.tk
Then, go to your DNS provider for
moarcatz.tk and add a CNAME record for:
This will do two things: