Question is simple. i tried to use raise Http404 from middleware and that is 
not working.

My middleware is :

import urlparse
from django.contrib.sites.models import Site
from django.http import Http404

class GetSubdomainMiddleware:
        def process_request(self, request):
                site = Site.objects.filter(domain__exact = 
request.META['HTTP_HOST'])
                if site:
                        bits = 
urlparse.urlsplit(request.META['HTTP_HOST'])[2].split('.')
                        request.subdomain = bits[0]
                else:
                        raise Http404

-- 
Mirat Can Bayrak <miratcanbay...@gmail.com>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to