Use system.getHostname() everywhere
Replace os.environ['HTTP_HOST'] with system.getHostname(), as a
result we do not crash when 'HTTP_HOST' is unset now.
from django.conf.urls.defaults import *urlpatterns = patterns('django.contrib.flatpages.views', (r'^(?P<url>.*)$', 'flatpage'),)