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/.

Metadata

Release files for openedx-plugin-sample 3.8.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openedx-plugin-sample 3.8.11
File Size Uploaded Provenance Actions
openedx_plugin_sample-3.8.11.tar.gz 150.2 kB With provenance Details for openedx_plugin_sample-3.8.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openedx-plugin-sample 3.8.11
File Interpreter ABI Platform Actions
openedx_plugin_sample-3.8.11-py3-none-any.whl Python 3 none any Details for openedx_plugin_sample-3.8.11-py3-none-any.whl

Total release size: 174.8 kB

Release files / openedx_plugin_sample-3.8.11.tar.gz

Download URL openedx_plugin_sample-3.8.11.tar.gz
Size 150.2 kB
Tags Source
SHA-256 checksum
How to use checksums
98809dca6c2f3a4d5a6f0a290fa23d5576d0683c4d522958ffe2ec69eabcb73f
BLAKE2b-256 checksum
How to use checksums
c738391874645805c9428ea040681aab4c7e743a75ebe8fbf8c61b649f3ca298
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / openedx_plugin_sample-3.8.11-py3-none-any.whl

Download URL openedx_plugin_sample-3.8.11-py3-none-any.whl
Size 24.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b7c90bb0ee29b0d5852e11a2a86a79d0173adeac9db292f783a2e9223fe6151
BLAKE2b-256 checksum
How to use checksums
f9e4d0a7653a6a819e1557c39c65210943b90d081ae25d25d3fcf0e1e5abcd94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for openedx-plugin-sample 3.8.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for openedx_plugin_sample-3.8.11.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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