- commit
- 8faaf5a789798b6e0d1b0b5215deb189245499fd
- parent
- 771380377130f0f49a96e3fb9301a96fb917edcd
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2021-01-12 20:25
use pathlib in settings
Diffstat
| M | settings/base.py | 5 | ++--- |
| M | settings/dev.py | 6 | +++--- |
2 files changed, 5 insertions, 6 deletions
diff --git a/settings/base.py b/settings/base.py
@@ -10,10 +10,9 @@ For the full list of settings and their values, see 10 10 https://docs.djangoproject.com/en/2.2/ref/settings/ 11 11 """ 12 1213 -1 import os-1 13 from pathlib import Path 14 1415 -1 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)16 -1 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))-1 15 BASE_DIR = Path(__file__).resolve().parent.parent 17 16 18 17 19 18 # Application definition
diff --git a/settings/dev.py b/settings/dev.py
@@ -18,11 +18,11 @@ ALLOWED_HOSTS = [] 18 18 DATABASES = { 19 19 'default': { 20 20 'ENGINE': 'django.db.backends.sqlite3',21 -1 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),-1 21 'NAME': BASE_DIR / 'db.sqlite3', 22 22 } 23 23 } 24 24 25 25 PRICE_BASE = 10 26 2627 -1 CONTRACT_TEMPLATE = os.path.join(BASE_DIR, 'example', 'content.xml')28 -1 CONTRACT_REFERENCE = os.path.join(BASE_DIR, 'example', 'contract.odt')-1 27 CONTRACT_TEMPLATE = BASE_DIR / 'example' / 'content.xml' -1 28 CONTRACT_REFERENCE = BASE_DIR / 'example' / 'contract.odt'