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

Begin by making sure that you have installed both django and chatterbot.

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

    # ...

API view

If you need an API endpoint for your chat bot you can add the following to your Django file. You can also choose to create your own views and end endpoints as needed.

urlpatterns = patterns(


You can run the Django database migrations for your chat bot with the following command.

python migrate django_chatterbot


Looking for a working example? Check our the example Django app using ChatterBot on GitHub:

MongoDB and Django

ChatterBot has a storage adapter for MongoDB but it does not work with Django. If you want to use MongoDB as your database for Django and your chat bot then you will need to install a Django storage backend such as Django MongoDB Engine.

The reason this is required is because Django’s storage backends are different and completely separate from ChatterBot’s storage adapters.