Skip to main content

backend-plugin-sample

A Django app plugin for edx-platform that adds a small course-archiving feature: learners can mark courses as archived (hidden from their active list) and unarchive them later. It demonstrates three backend extension points working together:

How to use it

See the root README for setup instructions. With Tutor, tutor-contrib-sample installs this plugin automatically (or bind-mounts your local checkout if you tutor mounts add it). Without Tutor, pip install -e . into your edx-platform environment and run migrations.

How it works

Plugin registration. apps.py declares the Django app to edx-platform via the plugin_app config (URL routing, settings, signal registration). The entry points in pyproject.toml make the platform discover the app automatically — no INSTALLED_APPS edit needed. See How to create a plugin app.

Model. models.py defines CourseArchiveStatus(user, course_id, is_archived, archive_date), indexed for the lookups the API performs. Registered in Django admin via admin.py.

REST API. views.py exposes the model as a DRF ModelViewSet at /sample-plugin/api/v1/course-archive-status/, with per-user permissions, throttling, and pagination. Serializer in serializers.py; URLs in urls.py. Business logic (e.g. setting archive_date when is_archived becomes true) lives in perform_create/perform_update rather than in the serializer.

Event handler. signals.py listens for COURSE_ENROLLMENT_CHANGED and unarchives a learner's course when they upgrade to the verified track. An event (not a filter) is the right shape here because we want a one-time nudge at the moment of upgrade — if the learner re-archives the course later, we respect that. A filter would re-impose the rule on every render.

Filter. pipeline.py implements ChangeCourseAboutPageUrl, a PipelineStep for org.openedx.learning.course.about.render.started.v1 that rewrites course-about URLs to an external host. Registered via OPEN_EDX_FILTERS_CONFIG in settings/common.py.

Settings. Per-environment settings live in settings/ (common.py, production.py, test.py). The plugin app loads these via its plugin_app config in apps.py.

Testing and quality

cd backend-plugin-sample
make requirements   # install test deps
make test           # pytest
make quality        # lint

Tests live in tests/.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openedx_plugin_sample-3.7.0.tar.gz (147.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openedx_plugin_sample-3.7.0-py2.py3-none-any.whl (24.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file openedx_plugin_sample-3.7.0.tar.gz.

File metadata

  • Download URL: openedx_plugin_sample-3.7.0.tar.gz
  • Upload date:
  • Size: 147.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for openedx_plugin_sample-3.7.0.tar.gz
Algorithm Hash digest
SHA256 e52852a451ce4cf57d56dec561076beb0fc22b8ff1ebae98ddcff365f49aa24b
MD5 c7498b3dcdba78493560ee534c0ca2bc
BLAKE2b-256 22ef9405a35e1fc5262f590628b416f25f9d0f666ff1bbde3f125f5a9adbad72

See more details on using hashes here.

File details

Details for the file openedx_plugin_sample-3.7.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for openedx_plugin_sample-3.7.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c86f74b433bd16a6514b72bd939115028139217f3a5b0431c52d04db21300df5
MD5 2358c73e56ef5b96f6b8d434e3fde196
BLAKE2b-256 4f50a28930b87c317022ddef7efe4849065b208031bb81e507d47a9f7444da71

See more details on using hashes here.

Release history Release notifications | RSS feed

3.8.0

2 files

3.7.4

2 files

3.7.3

2 files

3.7.2

2 files

This release

3.7.0 This release

2 files

3.6.1

2 files

3.6.0

2 files

3.5.0

2 files

3.4.0

2 files

3.3.0

2 files

3.2.0

2 files

3.1.0

2 files

3.0.1

2 files

3.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page