|
10 | 10 | https://docs.djangoproject.com/en/dev/ref/settings/ |
11 | 11 | """ |
12 | 12 |
|
13 | | -import os |
14 | 13 | from functools import partial |
| 14 | +from pathlib import Path |
15 | 15 |
|
16 | 16 | import sentry_sdk |
17 | 17 | from decouple import Csv, config |
18 | 18 | from dj_database_url import parse as dburl |
19 | 19 | from sentry_sdk.integrations.celery import CeleryIntegration |
20 | 20 | from sentry_sdk.integrations.django import DjangoIntegration |
21 | 21 |
|
22 | | -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
23 | | - |
| 22 | +# BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| 23 | +BASE_DIR = Path(__file__).resolve().parent.parent |
24 | 24 | # SECURITY WARNING: keep the secret key used in production secret! |
25 | 25 | SECRET_KEY = config('SECRET_KEY') |
26 | 26 |
|
|
161 | 161 |
|
162 | 162 | # Database |
163 | 163 | # https://docs.djangoproject.com/en/dev/ref/settings/#databases |
164 | | -default_db_url = 'sqlite:///' + os.path.join(BASE_DIR, 'db.sqlite3') |
| 164 | +default_db_url = 'sqlite:///' + str(BASE_DIR / 'db.sqlite3') |
165 | 165 |
|
166 | 166 | if 'localhost' not in ALLOWED_HOSTS: |
167 | 167 | dburl = partial(dburl, conn_max_age=600, ssl_require=True) |
|
240 | 240 |
|
241 | 241 | # Configuration for dev environment |
242 | 242 | MEDIA_URL = '/media/' |
243 | | -MEDIA_ROOT = os.path.join(BASE_DIR, 'mediafiles') |
| 243 | +MEDIA_ROOT = str(BASE_DIR / 'mediafiles') |
244 | 244 | STATIC_URL = '/static/' |
245 | | -STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') |
| 245 | +STATIC_ROOT = str(BASE_DIR / 'staticfiles') |
246 | 246 | COLLECTFAST_ENABLED = False |
247 | 247 |
|
248 | 248 | # STORAGE CONFIGURATION IN S3 AWS |
|
0 commit comments