diff --git a/karbs/__init__.py b/kristofersxyz/apps/karbs/__init__.py similarity index 100% rename from karbs/__init__.py rename to kristofersxyz/apps/karbs/__init__.py diff --git a/karbs/admin.py b/kristofersxyz/apps/karbs/admin.py similarity index 100% rename from karbs/admin.py rename to kristofersxyz/apps/karbs/admin.py diff --git a/karbs/apps.py b/kristofersxyz/apps/karbs/apps.py similarity index 100% rename from karbs/apps.py rename to kristofersxyz/apps/karbs/apps.py diff --git a/karbs/migrations/__init__.py b/kristofersxyz/apps/karbs/migrations/__init__.py similarity index 100% rename from karbs/migrations/__init__.py rename to kristofersxyz/apps/karbs/migrations/__init__.py diff --git a/karbs/models.py b/kristofersxyz/apps/karbs/models.py similarity index 100% rename from karbs/models.py rename to kristofersxyz/apps/karbs/models.py diff --git a/karbs/tests.py b/kristofersxyz/apps/karbs/tests.py similarity index 100% rename from karbs/tests.py rename to kristofersxyz/apps/karbs/tests.py diff --git a/karbs/urls.py b/kristofersxyz/apps/karbs/urls.py similarity index 100% rename from karbs/urls.py rename to kristofersxyz/apps/karbs/urls.py diff --git a/karbs/views.py b/kristofersxyz/apps/karbs/views.py similarity index 100% rename from karbs/views.py rename to kristofersxyz/apps/karbs/views.py diff --git a/main/__init__.py b/kristofersxyz/apps/main/__init__.py similarity index 100% rename from main/__init__.py rename to kristofersxyz/apps/main/__init__.py diff --git a/main/admin.py b/kristofersxyz/apps/main/admin.py similarity index 100% rename from main/admin.py rename to kristofersxyz/apps/main/admin.py diff --git a/main/apps.py b/kristofersxyz/apps/main/apps.py similarity index 100% rename from main/apps.py rename to kristofersxyz/apps/main/apps.py diff --git a/main/migrations/__init__.py b/kristofersxyz/apps/main/migrations/__init__.py similarity index 100% rename from main/migrations/__init__.py rename to kristofersxyz/apps/main/migrations/__init__.py diff --git a/main/models.py b/kristofersxyz/apps/main/models.py similarity index 100% rename from main/models.py rename to kristofersxyz/apps/main/models.py diff --git a/main/tests.py b/kristofersxyz/apps/main/tests.py similarity index 100% rename from main/tests.py rename to kristofersxyz/apps/main/tests.py diff --git a/main/urls.py b/kristofersxyz/apps/main/urls.py similarity index 100% rename from main/urls.py rename to kristofersxyz/apps/main/urls.py diff --git a/main/views.py b/kristofersxyz/apps/main/views.py similarity index 100% rename from main/views.py rename to kristofersxyz/apps/main/views.py diff --git a/kristofersxyz/settings.py b/kristofersxyz/settings.py index 1767051..508c13d 100644 --- a/kristofersxyz/settings.py +++ b/kristofersxyz/settings.py @@ -11,17 +11,18 @@ https://docs.djangoproject.com/en/4.0/ref/settings/ """ import json +import sys from pathlib import Path - # Build paths inside the project like this: BASE_DIR / "subdir". -BASE_DIR = Path(__file__).resolve().parent.parent +BASE_PATH = Path(__file__).resolve().parent.parent +sys.path.insert(0, str(BASE_PATH.joinpath("kristofersxyz", "apps"))) # SECURITY WARNING: don"t run with debug turned on in production! -DEBUG = Path.joinpath(BASE_DIR, "debug").is_file() +DEBUG = BASE_PATH.joinpath("debug").is_file() -with open(Path.joinpath(BASE_DIR, "config.json"), "r", encoding="UTF-8") as config_file: +with open(BASE_PATH.joinpath("config.json"), "r", encoding="UTF-8") as config_file: config = json.load(config_file) # Quick-start development settings - unsuitable for production @@ -62,7 +63,7 @@ ROOT_URLCONF = "kristofersxyz.urls" TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", - "DIRS": [Path.joinpath(BASE_DIR, "templates")], + "DIRS": [BASE_PATH.joinpath("templates")], "APP_DIRS": True, "OPTIONS": { "context_processors": [ @@ -84,7 +85,7 @@ WSGI_APPLICATION = "kristofersxyz.wsgi.application" DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", - "NAME": BASE_DIR / "db.sqlite3", + "NAME": BASE_PATH / "db.sqlite3", } } @@ -125,8 +126,8 @@ USE_TZ = True # STATIC_URL = Path.joinpath(BASE_DIR, "static") STATIC_URL = "/static/" -STATIC_ROOT = Path.joinpath(BASE_DIR, "static") -MEDIA_ROOT = Path.joinpath(BASE_DIR, "media") +STATIC_ROOT = BASE_PATH.joinpath("static") +MEDIA_ROOT = BASE_PATH.joinpath("media") # Default primary key field type diff --git a/requirements.txt b/requirements.txt index a5e9457..160dc1a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1 @@ -asgiref==3.5.2 Django==4.1 -pycodestyle==2.9.1 -sqlparse==0.4.2 -toml==0.10.2