<commit_before>========================
rapidsms.contrib.default
========================

Usage
=====

The `default` app allows your project to define a default response to an
`IncomingMessage` that is not handled by any other app. The response string
is defined in :setting:`DEFAULT_RESPONSE`.

This app operates during the :ref:`default message processing stage
<phase-default>`. It is very important that the router loads this app last,
both because all other apps should have the opportunity to handle the message
before falling back to this app, and because this app does not prevent the
execution of default stages of the apps that come after it.

The app passes the value of :setting:`PROJECT_NAME` to the response string. To
include the project name, use ``%(project_name)s`` in the response string.

If :setting:`DEFAULT_RESPONSE` is `None`, the `default` app will not send a
message.

By default, :setting:`DEFAULT_RESPONSE` is defined as::

    DEFAULT_RESPONSE = "Sorry, %(project_name)s could not understand your message."

Installation
============

To use the `default` app, simply add 'rapidsms.contrib.default' to the end of
:setting:`INSTALLED_APPS` in your settings file. The :doc:`BlockingRouter
</topics/router/router>` automatically loads the RapidSMS apps defined in
:setting:`INSTALLED_APPS`.<commit_msg>refs #218 - Clarified information about routers + app loading<commit_after>========================
rapidsms.contrib.default
========================

Usage
=====

The `default` application allows your project to define a default response to
an `IncomingMessage` that is not handled by any other application. The
response string is defined in :setting:`DEFAULT_RESPONSE`.

This application operates during the :ref:`default message processing stage
<phase-default>`. It is very important that the router loads this application
last, both because all other applications should have the opportunity to
handle the message before falling back to this one, and because this
application does not prevent the execution of default stages of the
applications that come after it.

The application passes the value of :setting:`PROJECT_NAME` to the response
string. To include the project name, use ``%(project_name)s`` in the response
string.

If :setting:`DEFAULT_RESPONSE` is `None`, the `default` application will not
send a message.

By default, :setting:`DEFAULT_RESPONSE` is defined as::

    DEFAULT_RESPONSE = "Sorry, %(project_name)s could not understand your message."

Installation
============

To use the `default` application, add 'rapidsms.contrib.default' to the end of
:setting:`INSTALLED_APPS` in your settings file. Depending on your project's
router, you may need to add the `default` application to the router's
associated applications. If you are using the :doc:`BlockingRouter
</topics/router/router>` or :doc:`CeleryRouter </topics/router/celery>`,
RapidSMS applications defined in :setting:`INSTALLED_APPS` will be
automatically loaded.
{'fraction_non_alphanumeric': 0.1110738255033557, 'fraction_numerical': 0.0010067114093959733, 'mean_word_length': 5.713963963963964, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '947964', 'n_tokens_mistral': 784, 'n_tokens_neox': 757, 'n_words': 367}