security.py: do not rely on get_host() function removed in Django 1.5