Did I find the right examples for you? yes no

All Samples(23)  |  Call(17)  |  Derive(0)  |  Import(6)

src/h/u/humfrey-0.3.9/humfrey/desc/views.py   humfrey(Download)
class IdView(MappingView, StoreView, ContentNegotiatedView):
    id_mapping_redirects = tuple((re.compile(a), b, frozenset(c)) for a,b,c in getattr(settings, 'ID_MAPPING_REDIRECTS', ()))
 
    if 'django_hosts' in settings.INSTALLED_APPS:
        from django_hosts.middleware import HostsMiddleware
        hosts_middleware = HostsMiddleware()

src/h/u/humfrey-HEAD/humfrey/desc/views.py   humfrey(Download)
class IdView(MappingView, StoreView, ContentNegotiatedView):
    id_mapping_redirects = tuple((re.compile(a), b, frozenset(c)) for a,b,c in getattr(settings, 'ID_MAPPING_REDIRECTS', ()))
 
    if 'django_hosts' in settings.INSTALLED_APPS:
        from django_hosts.middleware import HostsMiddleware
        hosts_middleware = HostsMiddleware()

src/d/a/dataox-HEAD/dataox/staging/middleware.py   dataox(Download)
class StagingMiddleware(object):
    hosts_middleware = middleware.HostsMiddleware()
 
    path_info_re = re.compile(r'/(?P<host>[a-z\-.]+)(?P<path>/.*)$')
    def process_request(self, request):

src/d/j/django-hosts-HEAD/django_hosts/tests/test_sites.py   django-hosts(Download)
from __future__ import with_statement
 
from django.contrib.sites.models import Site
 
from django_hosts.middleware import HostsMiddleware
    def test_sites_callback(self):
        rf = RequestFactory(HTTP_HOST='wiki.site1')
        request = rf.get('/simple/')
        middleware = HostsMiddleware()
        middleware.process_request(request)
    def test_sites_cached_callback(self):
        rf = RequestFactory(HTTP_HOST='admin.site4')
        request = rf.get('/simple/')
        middleware = HostsMiddleware()
        middleware.process_request(request)
    def test_sites_callback_with_parent_host(self):
        rf = RequestFactory(HTTP_HOST='wiki.site2')
        request = rf.get('/simple/')
        middleware = HostsMiddleware()
        middleware.process_request(request)
    def test_manager_simple(self):
        rf = RequestFactory(HTTP_HOST='wiki.site2')
        request = rf.get('/simple/')
        middleware = HostsMiddleware()
        middleware.process_request(request)

src/d/j/django-hosts-HEAD/django_hosts/tests/test_middleware.py   django-hosts(Download)
from django.core.exceptions import ImproperlyConfigured
 
from django_hosts.middleware import HostsMiddleware
from django_hosts.tests.base import (override_settings, HostsTestCase,
                                     RequestFactory)
    def test_request_urlconf_module(self):
        rf = RequestFactory(HTTP_HOST='other.example.com')
        request = rf.get('/simple/')
        middleware = HostsMiddleware()
        middleware.process_request(request)
    def test_fallback_to_defaulthost(self):
        rf = RequestFactory(HTTP_HOST='ss.example.com')
        request = rf.get('/template/test/')
        middleware = HostsMiddleware()
        middleware.process_request(request)

src/d/j/django-hosts-0.6/django_hosts/tests/test_sites.py   django-hosts(Download)
from __future__ import with_statement
 
from django.contrib.sites.models import Site
 
from django_hosts.middleware import HostsMiddleware
    def test_sites_callback(self):
        rf = RequestFactory(HTTP_HOST='wiki.site1')
        request = rf.get('/simple/')
        middleware = HostsMiddleware()
        middleware.process_request(request)
    def test_sites_cached_callback(self):
        rf = RequestFactory(HTTP_HOST='admin.site4')
        request = rf.get('/simple/')
        middleware = HostsMiddleware()
        middleware.process_request(request)
    def test_sites_callback_with_parent_host(self):
        rf = RequestFactory(HTTP_HOST='wiki.site2')
        request = rf.get('/simple/')
        middleware = HostsMiddleware()
        middleware.process_request(request)
    def test_manager_simple(self):
        rf = RequestFactory(HTTP_HOST='wiki.site2')
        request = rf.get('/simple/')
        middleware = HostsMiddleware()
        middleware.process_request(request)

src/d/j/django-hosts-0.6/django_hosts/tests/test_middleware.py   django-hosts(Download)
from django.core.exceptions import ImproperlyConfigured
 
from django_hosts.middleware import HostsMiddleware
from django_hosts.tests.base import (override_settings, HostsTestCase,
                                     RequestFactory)
    def test_request_urlconf_module(self):
        rf = RequestFactory(HTTP_HOST='other.example.com')
        request = rf.get('/simple/')
        middleware = HostsMiddleware()
        middleware.process_request(request)
    def test_fallback_to_defaulthost(self):
        rf = RequestFactory(HTTP_HOST='ss.example.com')
        request = rf.get('/template/test/')
        middleware = HostsMiddleware()
        middleware.process_request(request)