Using the [openedx-plugin](https://github.com/eduNEXT/cookiecutter-openedx-plugin.git) cookiecutter, I created a local django project to use as plugin and implemented basic functionality that listens to the user_logged_in Django signal.
from django.dispatch import receiver
from django.contrib.auth.signals import user_logged_in
@receiver(user_logged_in)
def my_custom_login_stuff(sender, request, user, **kwargs):
print('User has logged in. Some extra functionality.')
However, my main issue is making this plugin available and recognized inside the Open edX devstack containers (e.g., LMS/CMS). The documentation states that if I declare the plugin’s entry point correctly in setup.py (under edx_django_service_plugins), I shouldn’t need to manually add it to INSTALLED_APPS in the Open edX settings files.
Despite setting up the entry point, my plugin doesn’t seem to load or trigger inside the Open edX environment. It appears that the Open edX app isn’t detecting it at all.
My questions:
What is the proper way to install and register a custom Django plugin inside Open edX’s devstack so it gets picked up at runtime?
Are there additional steps required beyond the entry_points setup, especially when working in a local devstack setup?
Any help would be appreciated! I’m starting to get frustrated because I can’t get the plugin to work within the Open edX container environment.
Third, the approach mentioned in following links will help you to create custom django application which will be installed in Open edX, not django project.
You can follow following blog post to start with Open edX plugin architecture:
This blog post also covers basic things required in your plugin application, you can mimic this and create your own plugin app.
Yeah, I installed Open edX with Tutor.
I gave the first link a second read, and I was finally able to get my plugin working by copying my plugin project directory into the LMS container and then manually installing it inside the running container. Working this way this feels a bit tedious. Is there a better way to install this custom plugin in Open edX during development?
You don’t need to copy it manually inside your container, instead you can push your plugin changes to GitHub/GitLab and then use tutor feature to install external dependencies using the following setting: OPENEDX_EXTRA_PIP_REQUIREMENTS
Recently I haven’t worked on this, so I won’t be able to provide guide for this but you can refer to Open edX tutor documentation for it,