I use the django adpater like this:
chatterbot = ChatBot("yst",
storage_adapter='chatterbot.storage.DjangoStorageAdapter',
trainer='chatterbot.trainers.ChatterBotCorpusTrainer'
)
chatterbot.train('chatterbot.corpus.chinese')
When I run my project in django,got the error:
chatterbot.train('chatterbot.corpus.chinese')
File "/home/chris/.local/lib/python2.7/site-packages/chatterbot/trainers.py", line 133, in train
statement = self.get_or_create(text)
File "/home/chris/.local/lib/python2.7/site-packages/chatterbot/trainers.py", line 28, in get_or_create
statement = self.storage.find(statement_text)
File "/home/chris/.local/lib/python2.7/site-packages/chatterbot/storage/django_storage.py", line 41, in find
Statement = self.get_model('statement')
File "/home/chris/.local/lib/python2.7/site-packages/chatterbot/storage/storage_adapter.py", line 34, in get_model
return get_model_method()
File "/home/chris/.local/lib/python2.7/site-packages/chatterbot/storage/django_storage.py", line 22, in get_statement_model
return apps.get_model(self.django_app_name, 'Statement')
File "/home/chris/.local/lib/python2.7/site-packages/django/apps/registry.py", line 200, in get_model
app_config = self.get_app_config(app_label)
File "/home/chris/.local/lib/python2.7/site-packages/django/apps/registry.py", line 156, in get_app_config
raise LookupError(message)
LookupError: No installed app with label 'django_chatterbot'.
You have add django_chatterbot INSTALED_APPS list.
More information on Django applications https://docs.djangoproject.com/en/2.0/ref/applications/
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
You have add
django_chatterbotINSTALED_APPS list.https://github.com/gunthercox/ChatterBot/blob/755b3cad69523fcd16a19a2f65f94b5571f7ab9b/examples/django_app/example_app/settings.py#L29
More information on Django applications https://docs.djangoproject.com/en/2.0/ref/applications/