diff options
| author | Bobby <[email protected]> | 2022-08-02 19:45:53 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-08-02 19:45:53 +0530 |
| commit | d08afc2e7e8f699d00c8b254cbe1f83b845c70bb (patch) | |
| tree | 336f971e4f84ae4b0b80c774a6f3bc2c2039b628 | |
| parent | 09fc14c16b6b9ba4435b8b329a5b9a25c38b8836 (diff) | |
| download | thatcomputerscientist-d08afc2e7e8f699d00c8b254cbe1f83b845c70bb.tar.xz thatcomputerscientist-d08afc2e7e8f699d00c8b254cbe1f83b845c70bb.zip | |
Added subdomains middleware
| -rw-r--r-- | thatcomputerscientist/settings.py | 7 | ||||
| -rw-r--r-- | thatcomputerscientist/urls.py | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/thatcomputerscientist/settings.py b/thatcomputerscientist/settings.py index 13d649f5..080535e9 100644 --- a/thatcomputerscientist/settings.py +++ b/thatcomputerscientist/settings.py @@ -59,8 +59,15 @@ MIDDLEWARE = [ 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', + 'middleware.subdomainmiddleware.SubdomainMiddleware', + 'middleware.subdomainmiddleware.SubdomainURLRouting', ] +CONFIGURED_SUBDOMAINS = { + '': 'thatcomputerscientist', + '*': 'userpages', +} + ROOT_URLCONF = 'thatcomputerscientist.urls' diff --git a/thatcomputerscientist/urls.py b/thatcomputerscientist/urls.py index ca983e21..f1587104 100644 --- a/thatcomputerscientist/urls.py +++ b/thatcomputerscientist/urls.py @@ -14,10 +14,11 @@ Including another URLconf 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin -from django.urls import path, include +from django.urls import path, include, re_path urlpatterns = [ path('admin/', admin.site.urls), path('', include('blog.urls')), path('users/', include('users.urls', namespace='users')), + path('', include(('userpages.urls', 'userpages'), namespace='userpages')), ] |
