From 0e7c337dcb5d0c138c783033512fe3cde44f1b5f Mon Sep 17 00:00:00 2001 From: Angel Rey Date: Wed, 30 Sep 2020 14:54:32 -0500 Subject: [PATCH] Replaced os.path in settings.py --- archivebox/core/settings.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/archivebox/core/settings.py b/archivebox/core/settings.py index 14b3b369..5cb15cdb 100644 --- a/archivebox/core/settings.py +++ b/archivebox/core/settings.py @@ -2,6 +2,7 @@ __package__ = 'archivebox.core' import os import sys +from pathlib import Path from django.utils.crypto import get_random_string @@ -49,9 +50,9 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ - os.path.join(PYTHON_DIR, 'themes', ACTIVE_THEME), - os.path.join(PYTHON_DIR, 'themes', 'default'), - os.path.join(PYTHON_DIR, 'themes'), + Path(PYTHON_DIR) / 'themes' / ACTIVE_THEME, + Path(PYTHON_DIR) / 'themes' / 'default', + Path(PYTHON_DIR) / 'themes', ], 'APP_DIRS': True, 'OPTIONS': { @@ -70,7 +71,7 @@ WSGI_APPLICATION = 'core.wsgi.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(OUTPUT_DIR, SQL_INDEX_FILENAME), + 'NAME': Path(OUTPUT_DIR) / SQL_INDEX_FILENAME, } } @@ -105,7 +106,7 @@ SHELL_PLUS_PRINT_SQL = False IPYTHON_ARGUMENTS = ['--no-confirm-exit', '--no-banner'] IPYTHON_KERNEL_DISPLAY_NAME = 'ArchiveBox Django Shell' if IS_SHELL: - os.environ['PYTHONSTARTUP'] = os.path.join(PYTHON_DIR, 'core', 'welcome_message.py') + os.environ['PYTHONSTARTUP'] = Path(PYTHON_DIR) / 'core' / 'welcome_message.py' LANGUAGE_CODE = 'en-us' @@ -122,6 +123,6 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' STATIC_URL = '/static/' STATICFILES_DIRS = [ - os.path.join(PYTHON_DIR, 'themes', ACTIVE_THEME, 'static'), - os.path.join(PYTHON_DIR, 'themes', 'default', 'static'), + Path(PYTHON_DIR) / 'themes' / ACTIVE_THEME / 'static', + Path(PYTHON_DIR) / 'themes' / 'default' / 'static', ]