From 3ca7e95683085e0d4addc3a05314ec41d58702a1 Mon Sep 17 00:00:00 2001 From: Danial Keimasi Date: Thu, 4 Mar 2021 23:16:52 +0330 Subject: [PATCH] use pathlib for join path instead of os.path.join --- project_name/settings.py-tpl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/project_name/settings.py-tpl b/project_name/settings.py-tpl index 9dbaff3f..7019a8f9 100644 --- a/project_name/settings.py-tpl +++ b/project_name/settings.py-tpl @@ -7,7 +7,6 @@ https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/ """ -import os from pathlib import Path from configurations import Configuration, values @@ -75,7 +74,7 @@ class Common(Configuration): # Database # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases DATABASES = values.DatabaseURLValue( - 'sqlite:///{}'.format(os.path.join(BASE_DIR, 'db.sqlite3')) + 'sqlite:///{}'.format(BASE_DIR / 'db.sqlite3') ) # Password validation @@ -110,7 +109,7 @@ class Common(Configuration): # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/ STATIC_URL = '/static/' - STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') + STATIC_ROOT = BASE_DIR / 'staticfiles' STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' # Default primary key field type