mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 15:14:31 -04:00
Replaced os.path in settings.py
This commit is contained in:
parent
ce71747538
commit
0e7c337dcb
1 changed files with 8 additions and 7 deletions
|
@ -2,6 +2,7 @@ __package__ = 'archivebox.core'
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
from django.utils.crypto import get_random_string
|
from django.utils.crypto import get_random_string
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,9 +50,9 @@ TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
'DIRS': [
|
'DIRS': [
|
||||||
os.path.join(PYTHON_DIR, 'themes', ACTIVE_THEME),
|
Path(PYTHON_DIR) / 'themes' / ACTIVE_THEME,
|
||||||
os.path.join(PYTHON_DIR, 'themes', 'default'),
|
Path(PYTHON_DIR) / 'themes' / 'default',
|
||||||
os.path.join(PYTHON_DIR, 'themes'),
|
Path(PYTHON_DIR) / 'themes',
|
||||||
],
|
],
|
||||||
'APP_DIRS': True,
|
'APP_DIRS': True,
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
|
@ -70,7 +71,7 @@ WSGI_APPLICATION = 'core.wsgi.application'
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
'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_ARGUMENTS = ['--no-confirm-exit', '--no-banner']
|
||||||
IPYTHON_KERNEL_DISPLAY_NAME = 'ArchiveBox Django Shell'
|
IPYTHON_KERNEL_DISPLAY_NAME = 'ArchiveBox Django Shell'
|
||||||
if IS_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'
|
LANGUAGE_CODE = 'en-us'
|
||||||
|
@ -122,6 +123,6 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
STATICFILES_DIRS = [
|
STATICFILES_DIRS = [
|
||||||
os.path.join(PYTHON_DIR, 'themes', ACTIVE_THEME, 'static'),
|
Path(PYTHON_DIR) / 'themes' / ACTIVE_THEME / 'static',
|
||||||
os.path.join(PYTHON_DIR, 'themes', 'default', 'static'),
|
Path(PYTHON_DIR) / 'themes' / 'default' / 'static',
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue