Skip to content

Instantly share code, notes, and snippets.

@sinkap
Created July 23, 2023 15:08
Show Gist options
  • Save sinkap/c7900fd62a22b606bdf081e95b2c5458 to your computer and use it in GitHub Desktop.
Save sinkap/c7900fd62a22b606bdf081e95b2c5458 to your computer and use it in GitHub Desktop.
what to change
diff --git a/pinguinsite/settings.py b/pinguinsite/settings.py
index 011d1f0..4b46f47 100644
--- a/pinguinsite/settings.py
+++ b/pinguinsite/settings.py
@@ -10,15 +10,11 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.2/ref/settings/
"""
+import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
-BASE_DIR = Path(__file__).resolve().parent.parent
-
-# Importing os module
-import os
-
-BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+BASE_DIR = os.path.dirname(os.path.dirname(Path(__file__).resolve()))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
@@ -64,7 +60,7 @@ ROOT_URLCONF = 'pinguinsite.urls'
STATIC_URL = '/static/'
STATICFILES_DIRS = [
- os.path.join(BASE_DIR, 'pinguinsite/pinguinapp/static')
+ os.path.join(BASE_DIR, 'pinguinapp/static')
]
TEMPLATES = [
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment