If I understand your question correctly, the Django development server is not the problem. You will have to set up your DNS server to handle wildcard records or add specific subdomains to your hosts file.
As I'm sure you're aware of, the Django dev server defaults to using 127.0.0.1:8000
but you can override this. If you override it with localhost
it's likely handled by your /etc/hosts
file and not by DNS. If you override it with something not in the /etc/hosts file, it is handled by DNS.
The easy case of adding specific subdomains in the /etc/hosts
file, you've already covered in your question. Unfortunately you can't set up your hosts file to handle wildcard subdomains, for that you need to setup DNS (OSX Snow Leopard instructions).
Now — if you're okay with only testing through Firefox, you can solve the problem in a much easier way by using proxy autoconfiguration. See the answers to this StackOverflow question.