-
Notifications
You must be signed in to change notification settings - Fork 0
/
boot_django.py
41 lines (31 loc) · 873 Bytes
/
boot_django.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
import os
import django
from django.conf import settings
from pathlib import Path
import environ
env = environ.Env()
environ.Env.read_env()
BASE_DIR = Path(Path(__file__).parent, "backup_admin")
def boot_django():
settings.configure(
BASE_DIR=BASE_DIR,
DEBUG=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
}
},
INSTALLED_APPS=(
"backup_admin",
"dbbackup",
"django_extensions",
),
TIME_ZONE="UTC",
USE_TZ=True,
# django-dbbackup
DBBACKUP_STORAGE=env("DBBACKUP_STORAGE"),
DBBACKUP_STORAGE_OPTIONS={'location': env("DBBACKUP_STORAGE_OPTIONS")},
EXCLUDE=["backup_admin_backup", ]
)
django.setup()