-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbase.py
48 lines (40 loc) · 1.43 KB
/
base.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
Contains settings for both development and production environment.
"""
from environs import Env
from .defaults import *
env = Env()
env.read_env()
# Django
SECRET_KEY = env("DJANGO_SECRET_KEY")
DEBUG = env.bool("DJANGO_DEBUG", default=True)
WSGI_APPLICATION = "project.wsgi.application"
LANGUAGE_CODE = env.str("DJANGO_LANGUAGE_CODE", "en-us")
TIME_ZONE = env.str("DJANGO_TIME_ZONE", "UTC")
USE_I18N = env.bool("DJANGO_USE_I18N", True)
USE_L10N = env.bool("DJANGO_USE_L10N", True)
USE_TZ = env.bool("DJANGO_USE_TZ", True)
DATABASES = {
"default": {
"ENGINE": env.str("DJANGO_DB_ENGINE", default="django.db.backends.sqlite3"),
"NAME": env.str("DJANGO_DB_NAME", default=BASE_DIR / "db.sqlite3"),
"USER": env.str("DJANGO_DB_USER", default="postgres"),
"PASSWORD": env.str("DJANGO_DB_PASSWORD", default="nopassword"),
"HOST": env.str("DJANGO_DB_HOST", default="127.0.0.1"),
"PORT": str(env.int("DJANGO_DB_PORT", default=5432)),
}
}
STATIC_URL = env.str("DJANGO_STATIC_URL", "/static/")
ROOT_URLCONF = "project.urls"
# Django Extensions
INSTALLED_APPS.append("django_extensions")
# Rest Framework
INSTALLED_APPS.append("rest_framework")
# Core App
INSTALLED_APPS.append("core")
AUTH_USER_MODEL = "core.CoreUser"
# Celery
# TODO celery config
# You can add your own configuration for Celery here.
# You can use below as reference:
# https://realpython.com/asynchronous-tasks-with-django-and-celery/