diff --git a/taccsite_cms/custom_app_settings.example.py b/taccsite_cms/custom_app_settings.example.py index 8f58b8a1a..fb9165c55 100644 --- a/taccsite_cms/custom_app_settings.example.py +++ b/taccsite_cms/custom_app_settings.example.py @@ -1,3 +1,3 @@ CUSTOM_APPS = ['apps.custom_example', 'apps.djangocms_blog_customizations'] -CUSTOM_MIDDLEWARE = ['taccsite_cms.middleware.settings.DynamicSiteIdMiddleware'] +CUSTOM_MIDDLEWARE = [] STATICFILES_DIRS = () diff --git a/taccsite_cms/middleware/settings.py b/taccsite_cms/middleware/settings.py deleted file mode 100644 index f96761211..000000000 --- a/taccsite_cms/middleware/settings.py +++ /dev/null @@ -1,20 +0,0 @@ -from django.conf import settings -from urllib.parse import urlparse -from django.contrib.sites.models import Site - -class DynamicSiteIdMiddleware: - def __init__(self, get_response): - self.get_response = get_response - - def __call__(self, request): - # One-time configuration and initialization. - try: - current_site = Site.objects.get(domain=request.get_host()) - except Site.DoesNotExist: - current_site = Site.objects.get(id=settings.DEFAULT_SITE_ID) - - request.current_site = current_site - settings.SITE_ID = current_site.id - - response = self.get_response(request) - return response