Django Integration

ChatterBot has direct support for integration with Django. ChatterBot provides out of the box models and endpoints that allow you build ChatterBot powered Django applications.

Install packages

Install with pip

pip install django chatterbot

For more details on installing Django, see the Django documentation.

Installed Apps

Add chatterbot.ext.django_chatterbot to your INSTALLED_APPS

INSTALLED_APPS = (
    # ...
    'chatterbot.ext.django_chatterbot',
)

API view

If you need a ChatterBot API endpoint you will want to add the following to your urls.py

urlpatterns = patterns(
    ...
    url(r'^chatterbot/', include('chatterbot.ext.django_chatterbot.urls', namespace='chatterbot')),
)

Sync your database

python manage.py migrate django_chatterbot

Note

Looking for a working example? Check our the example Django app using ChatterBot on GitHub: https://github.com/gunthercox/ChatterBot/tree/master/examples/django_app