Skip to main content

A Learning Management System extension for Wagtail with SCORM 1.2/2004 support

Project description

Wagtail LMS

A Learning Management System extension for Wagtail CMS with SCORM 1.2/2004 support.

⚠️ Alpha Release

This package is in early development.

Currently tested on:

  • Python 3.13.0
  • Django 5.2.3
  • Wagtail 7.0.1

Other versions may work but are untested. Refer to the Roadmap for planned enhancements, including broader version support and CI/CD integration.

Features

  • 📚 Course Management - Integrate courses into Wagtail's page system
  • 📦 SCORM Support - Full SCORM 1.2 and 2004 package compatibility
  • 👥 Enrollment Tracking - Automatic student enrollment and progress monitoring
  • 📊 SCORM API - Complete runtime API implementation for content interactivity
  • 🔒 Secure Delivery - Path-validated content serving with iframe support
  • 💾 Progress Persistence - CMI data model storage with suspend/resume capability
  • 🔄 Concurrency Handling - Retry logic for SQLite database lock scenarios
  • 🎨 Framework Agnostic - Minimal default styling, easy to customize with any CSS framework

Development Status

Core functionality tested and working

  • Comprehensive test suite with 86% code coverage
  • 65+ tests covering models, views, API, and integration workflows
  • Example project fully functional for development and testing
  • Database lock handling for concurrent SCORM operations
  • Wagtail preview mode fully supported

See example_project/README.md for setup instructions.

Installation

pip install wagtail-lms

Quick Start

  1. Add to INSTALLED_APPS in your Django settings:

    INSTALLED_APPS = [
        # ...
        'wagtail_lms',
        # ...
    ]
    
  2. Add wagtail-lms URLs to your urls.py:

    from django.urls import path, include
    
    urlpatterns = [
        # ...
        path('lms/', include('wagtail_lms.urls')),
        # ...
    ]
    
  3. Run migrations:

    python manage.py migrate wagtail_lms
    
  4. Collect static files:

    python manage.py collectstatic
    

Configuration

Optional settings in your Django settings:

# SCORM package upload directory
WAGTAIL_LMS_SCORM_UPLOAD_PATH = 'scorm_packages/'

# Extracted SCORM content directory
WAGTAIL_LMS_CONTENT_PATH = 'scorm_content/'

# Auto-enroll users when they visit a course
WAGTAIL_LMS_AUTO_ENROLL = False

Usage

Creating a Course

  1. Log into Wagtail admin
  2. Create a new "Course Page" under Pages
  3. Upload a SCORM package via Django Admin → SCORM Packages
  4. Assign the SCORM package to your course page

SCORM Package Requirements

  • Must be a valid SCORM 1.2 or 2004 ZIP file
  • Must contain imsmanifest.xml at the root
  • Launch file must be specified in the manifest

Customizing Templates

The package includes minimal, functional styling that works out of the box. To match your project's design:

  • Quick: Override the CSS classes in your own stylesheet
  • Full control: Override the templates in your project (standard Django approach)
  • Examples: See Template Customization Guide for Bootstrap, Tailwind CSS, and Bulma examples

For API-first projects, the templates are optional and can be ignored entirely.

Development

Running Tests

The project includes a comprehensive test suite with 86% code coverage.

# Install testing dependencies (pytest, pytest-django, pytest-cov)
uv sync --extra testing

# Run all tests
PYTHONPATH=. uv run pytest

# Run with coverage report
PYTHONPATH=. uv run pytest --cov=src/wagtail_lms --cov-report=term-missing

# Run specific test file
PYTHONPATH=. uv run pytest tests/test_models.py -v

Database Considerations

SQLite: The package includes retry logic with exponential backoff to handle database lock errors during concurrent SCORM API operations. For development with the example project:

# example_project/settings.py
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": "db.sqlite3",
        "OPTIONS": {
            "timeout": 20,  # Increased timeout for SCORM operations
        },
    }
}

Production: For production deployments, PostgreSQL is recommended for better concurrency handling:

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": "wagtail_lms",
        # ... other PostgreSQL settings
    }
}

Acknowledgments

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

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

Source Distribution

wagtail_lms-0.2.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

wagtail_lms-0.2.0-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file wagtail_lms-0.2.0.tar.gz.

File metadata

  • Download URL: wagtail_lms-0.2.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.2

File hashes

Hashes for wagtail_lms-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fd6f0c1ad0ba58395e7313c681b3f01cfcca1ff2aaf380f8667d0f543e651ad3
MD5 e76cb7a55b4888da455fa63620959111
BLAKE2b-256 9754891bae0735118cb3a9e8da4504f6508401310cc9dab388d7820c30dddcd5

See more details on using hashes here.

File details

Details for the file wagtail_lms-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wagtail_lms-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54077b92c29ff474a894096dfcb103df91afc6006be4cd812bf7b4c4d704d12f
MD5 73e4d8717c5c0c92f59bfd94d2c2e04c
BLAKE2b-256 06171a3c8024b602a3feda2a6f4f1a0ec34ce7a07ed423c70792354e9cf9f110

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page