diff options
| author | Bobby <[email protected]> | 2023-07-11 16:45:42 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2023-07-11 16:45:42 -0400 |
| commit | 0dfce68729c7bf768b035157849366fb40638bca (patch) | |
| tree | 6c5cf8c5a6f7e9a90cbb2f7e6ab07b4ef7cb748b | |
| parent | 1cb51e1729a65bd0cdffeace802854aa184e1e9b (diff) | |
| download | thatcomputerscientist-0dfce68729c7bf768b035157849366fb40638bca.tar.xz thatcomputerscientist-0dfce68729c7bf768b035157849366fb40638bca.zip | |
Solitude Started. Commiting. Not Pushing
| -rw-r--r-- | requirements.txt | 1 | ||||
| -rw-r--r-- | solitude/__init__.py | 0 | ||||
| -rw-r--r-- | solitude/admin.py | 3 | ||||
| -rw-r--r-- | solitude/apps.py | 6 | ||||
| -rw-r--r-- | solitude/migrations/__init__.py | 0 | ||||
| -rw-r--r-- | solitude/models.py | 3 | ||||
| -rw-r--r-- | solitude/tests.py | 3 | ||||
| -rw-r--r-- | solitude/urls.py | 9 | ||||
| -rw-r--r-- | solitude/views.py | 7 | ||||
| -rw-r--r-- | templates/@solitude/welcome.html | 1 | ||||
| -rw-r--r-- | thatcomputerscientist/hosts.py | 7 | ||||
| -rw-r--r-- | thatcomputerscientist/settings.py | 7 |
12 files changed, 46 insertions, 1 deletions
diff --git a/requirements.txt b/requirements.txt index e74e0160..91505927 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,3 +25,4 @@ numpy scikit-learn akismet google-cloud-translate +django-hosts diff --git a/solitude/__init__.py b/solitude/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/solitude/__init__.py diff --git a/solitude/admin.py b/solitude/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/solitude/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/solitude/apps.py b/solitude/apps.py new file mode 100644 index 00000000..d87e03c8 --- /dev/null +++ b/solitude/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class SolitudeConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "solitude" diff --git a/solitude/migrations/__init__.py b/solitude/migrations/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/solitude/migrations/__init__.py diff --git a/solitude/models.py b/solitude/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/solitude/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/solitude/tests.py b/solitude/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/solitude/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/solitude/urls.py b/solitude/urls.py new file mode 100644 index 00000000..68819664 --- /dev/null +++ b/solitude/urls.py @@ -0,0 +1,9 @@ +from django.urls import path + +from . import views + +app_name = 'solitude' + +urlpatterns = [ + path('', views.home, name='home'), +] diff --git a/solitude/views.py b/solitude/views.py new file mode 100644 index 00000000..212c84eb --- /dev/null +++ b/solitude/views.py @@ -0,0 +1,7 @@ +from django.shortcuts import render + +# Create your views here. +TEMPLATE_BASE_PATH = '@solitude' + +def home(request): + return render(request, f'{TEMPLATE_BASE_PATH}/welcome.html') diff --git a/templates/@solitude/welcome.html b/templates/@solitude/welcome.html new file mode 100644 index 00000000..a3fd191e --- /dev/null +++ b/templates/@solitude/welcome.html @@ -0,0 +1 @@ +<h1>Shifoo's Solitude</h1>
\ No newline at end of file diff --git a/thatcomputerscientist/hosts.py b/thatcomputerscientist/hosts.py new file mode 100644 index 00000000..503b3443 --- /dev/null +++ b/thatcomputerscientist/hosts.py @@ -0,0 +1,7 @@ +from django_hosts import patterns, host + +host_patterns = patterns( + '', + host(r'', 'thatcomputerscientist.urls', name='default'), + host(r'solitude', 'solitude.urls', name='solitude') +) diff --git a/thatcomputerscientist/settings.py b/thatcomputerscientist/settings.py index 8a142610..551e158d 100644 --- a/thatcomputerscientist/settings.py +++ b/thatcomputerscientist/settings.py @@ -57,6 +57,7 @@ INSTALLED_APPS = [ 'django.contrib.sitemaps', 'thatcomputerscientist', 'haystack', + 'django_hosts', 'blog', 'users', 'userpages', @@ -75,7 +76,11 @@ HAYSTACK_CONNECTIONS = { }, } +ROOT_HOSTCONF = 'thatcomputerscientist.hosts' +DEFAULT_HOST = 'default' + MIDDLEWARE = [ + 'django_hosts.middleware.HostsRequestMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', @@ -87,7 +92,7 @@ MIDDLEWARE = [ 'middleware.oldbrowsermiddleware.OldBrowserMiddleware', 'middleware.globalmetamiddleware.GlobalMetaMiddleware', 'middleware.uuidmiddleware.UserUUIDMiddleware', - # 'middleware.translationMiddleware.TranslationMiddleware', + 'django_hosts.middleware.HostsResponseMiddleware', ] CONFIGURED_SUBDOMAINS = { |
