Q:

How to set up conditional routes with Django?

I'm trying to switch from Pyramid to Django for a small project. The website can be accessed through multiple subdomains, and I want the same app to be able to route a request to a view only if certain conditions are met.
For example, route http://mysite.com/signup to the standard signup controller, and http://api.mysite.com/signup to the API controller.
Is there any Django equivalent for Pyramid route predicates?
Thanks!

A:

You could use django-hosts.
pip install django-hosts

