Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use pathlib for join path instead of os.path.join #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions project_name/settings.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down