The Database Backend

The database backend has a special purpose, and is primarily used for testing. When the router sends an outgoing message via the database backend, instead of sending a text message, the database backend stores the message in a database table.

The database backend is currently only used with httptester and with the unit test harness. Generally, you will not use the database backend in production deployments.

Configuring

To configure the database backend:

  1. Add its class to the INSTALLED_BACKENDS setting:
 INSTALLED_BACKENDS = {
     ...
     "my-db-backend": {
         "ENGINE": "rapidsms.backends.database.DatabaseBackend",
     },
     ...
 }
  1. Add its app to INSTALLED_APPS:
INSTALLED_APPS = [
    ...
    'rapidsms.backends.database',
    ...
]
  1. Create its database table:
./manage.py syncdb

If you’re using South, you should run migrations:

./manage.py migrate

No URLs need to be configured, since the database backend cannot receive messages from outside RapidSMS.