Skip to content

Commit

Permalink
docs: update signal receiver how-to
Browse files Browse the repository at this point in the history
Notes that the custom Django plugin config for signal
receivers is no longer recommended.
  • Loading branch information
robrap authored Nov 22, 2024
1 parent 8fcb8dd commit 5ca7490
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions docs/how-tos/using-events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,9 @@ Connecting signals can be done using regular django syntax:
def your_receiver_function(**kwargs):
# your implementation here
Or at the apps.py

.. code-block:: python
{
"signals_config": {
"lms.djangoapp": {
"relative_path": "your_module_name",
"receivers": [
{
"receiver_func_name": "your_receiver_function",
"signal_path": "openedx_events.learning.signals.STUDENT_REGISTRATION_COMPLETED",
},
],
}
}
}
In case you are listening to an event in an Open edX platform repo, you can directly
use the django syntax since the apps.py method will not be available without the
plugin system.
.. note::
You may encounter an older pattern for configuring signal receivers that is no longer recommended. This
outdated Django plugin configuration used ``plugin_app`` and ``signals_config`` in apps.py.

.. warning::
For non-trivial work, we encourage using asynchronous tasks in your receiver functions in order
Expand Down

0 comments on commit 5ca7490

Please sign in to comment.