PrivatePing is a secure messaging application built on Python's Django framework, providing end-to-end encryption for messages exchanged between users.
This pull request refactors the path handling in the Django project's settings files by using pathlib.Path instead of os.path. These changes improve readability, maintainability, and cross-platform compatibility of the settings configuration.
Changes Made:
Updated BASE_DIR Calculation:
Changed from using os.path to pathlib.Path for defining BASE_DIR.
Updated BASE_DIR Calculation:
Updated the DATABASES configuration to use BASE_DIR with pathlib.Path.
Modified STATICFILES_DIRS to use pathlib.Path for asset paths.
Production Settings:
Updated STATICFILES_DIRS to use pathlib.Path for static file paths.
Changed STATIC_ROOT to use pathlib.Path for the static root directory.
Detailed Changes:Updated BASE_DIR Calculation:
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
Summary:
This pull request refactors the path handling in the Django project's settings files by using
pathlib.Path
instead ofos.path
. These changes improve readability, maintainability, and cross-platform compatibility of the settings configuration.Changes Made:
BASE_DIR
Calculation:os.path
topathlib.Path
for definingBASE_DIR
.DATABASES
configuration to useBASE_DIR
withpathlib.Path
.STATICFILES_DIRS
to usepathlib.Path
for asset paths.STATICFILES_DIRS
to usepathlib.Path
for static file paths.STATIC_ROOT
to usepathlib.Path
for the static root directory.Detailed Changes: Updated
BASE_DIR
Calculation:Development Settings (
development.py
):Production Settings (
production.py
):Testing:
DATABASES
configuration.Additional Notes:
pathlib.Path
usage ensures better cross-platform compatibility and aligns with modern Python practices.Thank you for reviewing this pull request!