Skip to content

Commit 23d7a41

Browse files
committed
Fix setting setup
1 parent 988e138 commit 23d7a41

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ jobs:
5858
- name: Run tests for Django example app
5959
run: |
6060
python -m pip install "django<=4.1"
61-
python runtests.py
62-
python examples/django_example/manage.py test examples/django_example/
61+
python -Wonce runtests.py
62+
python -Wonce examples/django_example/manage.py test examples/django_example/
6363
# --------------------------------------------------------------
6464
# TODO: Fix & re-enable later
6565
# https://github.com/marketplace/actions/coveralls-github-action

chatterbot/ext/django_chatterbot/apps.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@ class DjangoChatterBotConfig(AppConfig):
66
name = 'chatterbot.ext.django_chatterbot'
77
label = 'django_chatterbot'
88
verbose_name = 'Django ChatterBot'
9+
10+
def ready(self):
11+
from chatterbot.ext.django_chatterbot import settings as defaults
12+
from django.conf import settings
13+
14+
settings.CHATTERBOT = getattr(settings, 'CHATTERBOT', {})
15+
settings.CHATTERBOT.update(defaults.CHATTERBOT_DEFAULTS)

chatterbot/ext/django_chatterbot/settings.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
from chatterbot import constants
66

77

8-
CHATTERBOT_SETTINGS = getattr(settings, 'CHATTERBOT', {})
8+
CHATTERBOT = getattr(settings, 'CHATTERBOT', {})
99

1010
CHATTERBOT_DEFAULTS = {
1111
'name': 'ChatterBot',
1212
'storage_adapter': 'chatterbot.storage.DjangoStorageAdapter',
1313
'django_app_name': constants.DEFAULT_DJANGO_APP_NAME
1414
}
1515

16-
CHATTERBOT = CHATTERBOT_DEFAULTS.copy()
17-
CHATTERBOT.update(CHATTERBOT_SETTINGS)
16+
CHATTERBOT.update(CHATTERBOT_DEFAULTS)

0 commit comments

Comments
 (0)