Skip to content

Commit 90f9e1f

Browse files
committed
Add database settings
1 parent 3819ed5 commit 90f9e1f

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from pathlib import Path
2+
3+
BASE_DIR = str(Path(__file__).parent.parent)
4+
5+
DATABASE_CONFIG = {
6+
'DATABASE_TYPE': 'sqlite3',
7+
'DATABASE_NAME': 'test_db',
8+
'DATABASE_DIRECTORY_PATH': BASE_DIR
9+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import os
2+
from pathlib import Path
3+
4+
PROJECT_NAME = 'test_project'
5+
6+
# Path that initializes the context
7+
CONTEXT_CONFIGURATION = 'test_project.configuration.context'
8+
9+
# Amount of concurrent workers each state can use
10+
MAX_CONCURRENT_WORKERS = 2
11+
12+
# Change this when not in development, feature or hot-fix branch
13+
DEBUG = int(os.environ.get('DEBUG', True))
14+
15+
BASE_DIR = str(Path(__file__).parent.parent)
16+
17+
LOG_FILE_NAME = 'log'
18+
19+
LOG_DIR = '{}/logs'.format(BASE_DIR)
20+
21+
LOG_PATH = "{}/{}.log".format(LOG_DIR, LOG_FILE_NAME)
22+
#
23+
# if not os.path.isdir(LOG_DIR):
24+
# os.mkdir(LOG_DIR)
25+
26+
if DEBUG:
27+
logging_level = "DEBUG"
28+
else:
29+
logging_level = "INFO"
30+
31+
# Logging configuration
32+
LOGGING = {
33+
'version': 1,
34+
'disable_existing_loggers': False,
35+
'formatters': {
36+
'standard': {
37+
'format': '%(levelname)s %(asctime)s - [thread: %(threadName)-4s %(name)s] %(message)s',
38+
'datefmt': '%Y-%m-%d %H:%M:%S'
39+
}
40+
},
41+
'handlers': {
42+
'console': {
43+
'class': 'logging.StreamHandler',
44+
'formatter': 'standard',
45+
},
46+
},
47+
'loggers': {
48+
'': {
49+
'level': logging_level,
50+
'handlers': ['console'],
51+
},
52+
},
53+
}
54+
55+
DATABASE_CONFIG = {
56+
57+
}

tests/resources/standard_settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33

44
PROJECT_NAME = 'test_project'
55

6+
# Path that initializes the context
67
CONTEXT_CONFIGURATION = 'test_project.configuration.context'
78

9+
# Amount of concurrent workers each state can use
10+
MAX_CONCURRENT_WORKERS = 2
11+
812
# Change this when not in development, feature or hot-fix branch
913
DEBUG = int(os.environ.get('DEBUG', True))
1014

0 commit comments

Comments
 (0)