Setup

This guide walks you through the steps to set up Django Action Triggers in your Django project after installation.

Note

If you have not yet installed the application, please refer to the Installation guide.

Configuration

1. Add to Installed Apps

To start using Django Action Triggers, you need to add the application to your Django project’s INSTALLED_APPS setting. Open your settings.py file and add the following line:

INSTALLED_APPS = [
    ...
    'django_action_triggers',
    ...
]

2. Configure Trigger and Action Settings (Optional)

You may want to customise some settings related to triggers and actions. For example, setting default messaging broker configurations or webhook endpoints. Add any relevant settings in your settings.py file:

More information on configuring triggers and actions can be found later in the the Action Trigger Settings guide.

# Example settings for action triggers
ACTION_TRIGGER_SETTINGS = {
    "default_webhook": {
        "url": "https://example.com/webhook",
        "method": "POST",
        "headers": {
            "Content-Type": "application/json"
        }
    }
}

Migrations

Once you have added the application to INSTALLED_APPS, you need to apply migrations to set up the necessary database tables. Run the following command in your terminal:

python manage.py migrate

This will create the required tables in your database for storing triggers and actions.