diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b3ecbeaa..7bc4204b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,7 +35,7 @@ repos: language: system types: [python] args: [--config-file=pyproject.toml] - exclude: ^(tests/|migrations/) + exclude: ^(tests/|migrations/|docs/) require_serial: true - id: django-check diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..2e49450e --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,17 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +python: + install: + - requirements: docs/requirements.txt + - method: pip + path: . + extra_requirements: + - docs + +sphinx: + configuration: docs/conf.py diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d0c3cbf1 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/images/add-course-form.png b/docs/images/add-course-form.png new file mode 100644 index 00000000..e692c221 Binary files /dev/null and b/docs/images/add-course-form.png differ diff --git a/docs/images/add-quiz-form.png b/docs/images/add-quiz-form.png new file mode 100644 index 00000000..3c57724a Binary files /dev/null and b/docs/images/add-quiz-form.png differ diff --git a/docs/images/course-contents-list.png b/docs/images/course-contents-list.png new file mode 100644 index 00000000..4e96c087 Binary files /dev/null and b/docs/images/course-contents-list.png differ diff --git a/docs/images/courses-table.png b/docs/images/courses-table.png new file mode 100644 index 00000000..5f14c7a9 Binary files /dev/null and b/docs/images/courses-table.png differ diff --git a/docs/images/edit-organization.png b/docs/images/edit-organization.png new file mode 100644 index 00000000..c15b82a5 Binary files /dev/null and b/docs/images/edit-organization.png differ diff --git a/docs/images/learner-progress.png b/docs/images/learner-progress.png new file mode 100644 index 00000000..0081d0a4 Binary files /dev/null and b/docs/images/learner-progress.png differ diff --git a/docs/images/organizations.png b/docs/images/organizations.png new file mode 100644 index 00000000..195d495f Binary files /dev/null and b/docs/images/organizations.png differ diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..747ffb7b --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..68eb353c --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +sphinx>=9.1 +sphinx-rtd-theme +django diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 00000000..f559abc2 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,27 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "Django Email Learning" +copyright = "2026, Payam Najafizadeh" +author = "Payam Najafizadeh" +release = "[v0.1.19]" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [] + +templates_path = ["_templates"] +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "alabaster" +html_static_path = ["_static"] diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 00000000..646a6b02 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,38 @@ +.. Django Email Learning documentation master file, created by + sphinx-quickstart on Thu Jan 22 11:34:26 2026. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Django Email Learning documentation +=================================== + + +.. toctree:: + :maxdepth: 2 + :caption: Getting Started + + introduction + installation + + +.. toctree:: + :maxdepth: 2 + :caption: User Guide (Platform) + + platform/organizations + platform/courses + platform/learners + +.. toctree:: + :maxdepth: 2 + :caption: Technical Reference + + technical/management-commands + + +.. .. toctree:: +.. :maxdepth: 1 +.. :caption: Project Philosophy + +.. philosophy/why-this-way +.. philosophy/contributing diff --git a/docs/source/installation.rst b/docs/source/installation.rst new file mode 100644 index 00000000..d7aeef2b --- /dev/null +++ b/docs/source/installation.rst @@ -0,0 +1,135 @@ +Installation +============ + +This guide will help you install and configure Django Email Learning in your Django project. + +.. warning:: + The library is currently in its early stages of development. The current version is an alpha release, + and while it includes core features, it may not yet be suitable for production use and future updates may introduce breaking changes. + + +Prerequisites +------------- + +- Python 3.10 or higher +- Django 5.0 or higher +- A configured email backend (for sending course emails) + +Installation Steps +------------------ + +1. **Install the Package** + + Install Django Email Learning via pip: + + .. code-block:: bash + + pip install django-email-learning + +2. **Add to INSTALLED_APPS** + + Add 'django_email_learning' to your INSTALLED_APPS in settings.py: + + .. code-block:: python + + INSTALLED_APPS = [ + # ... your other apps + 'django_email_learning', + # ... more apps + ] + +3. **Run Database Migrations** + + Create the necessary database tables: + + .. code-block:: bash + + python manage.py migrate django_email_learning + +4. **Configure URLs** + + Add Django Email Learning URLs to your project's main urls.py: + + .. code-block:: python + + from django.urls import path, include + + urlpatterns = [ + # ... your other URL patterns + path('email-learning/', include('django_email_learning.urls')), + # ... more URL patterns + ] + + You can change ``email-learning/`` to any URL path you prefer. This will make: + + - **Platform (Admin Interface)**: Available at ``/email-learning/platform/`` + - **Public Course Pages**: Available at ``/email-learning/public/organization//`` + - **API Endpoints**: Available under ``/email-learning/api/`` + +Access Control +-------------- + +**Platform Access** + +The course management platform (``/platform/``) requires authentication and is accessible to: + +- Django superusers +- Users assigned as Organization users (managed via Django admin panel) + +**Public Access** + +Public course enrollment pages are accessible without authentication and are designed for learners to discover and enroll in courses. + +Configuration +------------- + +Django Email Learning requires specific configuration in your Django settings. Add a ``DJANGO_EMAIL_LEARNING`` dictionary to your ``settings.py``: + +Required Settings +~~~~~~~~~~~~~~~~~ + +**SITE_BASE_URL** + +The base URL of your site, used to generate absolute URLs in emails and course links. + +.. code-block:: python + + DJANGO_EMAIL_LEARNING = { + 'SITE_BASE_URL': 'https://yourdomain.com', + } + +Optional Settings +~~~~~~~~~~~~~~~~~ + +**FROM_EMAIL** + +The default email address for outgoing course emails. If not specified, falls back to Django's ``DEFAULT_FROM_EMAIL`` setting. + +.. code-block:: python + + DJANGO_EMAIL_LEARNING = { + 'SITE_BASE_URL': 'https://yourdomain.com', + 'FROM_EMAIL': 'courses@yourdomain.com', + } + +Email Backend Configuration +--------------------------- + +Django Email Learning sends course content and notifications via email. Ensure your Django project has a properly configured email backend: + +.. code-block:: python + + # Example SMTP configuration + EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' + EMAIL_HOST = 'smtp.gmail.com' + EMAIL_PORT = 587 + EMAIL_USE_TLS = True + EMAIL_HOST_USER = 'your-email@gmail.com' + EMAIL_HOST_PASSWORD = 'your-app-password' + DEFAULT_FROM_EMAIL = 'your-email@gmail.com' + +Management Command Scheduling +----------------------------- +To automate content delivery, schedule the ``deliver_contents`` management command to run at regular intervals (e.g., every 15-60 minutes) using a task scheduler like cron or Celery Beat. + +See `Management Commands `_ for more details. diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst new file mode 100644 index 00000000..d1ca3a72 --- /dev/null +++ b/docs/source/introduction.rst @@ -0,0 +1,69 @@ +Introduction +============ + +.. image:: + https://github.com/AvaCodeSolutions/django-email-learning/raw/master/assets/Django2@2x.png + :alt: Django Email Learning + :align: center + :width: 200 px + + +Django Email Learning is an open-source Django application by `AvaCode Solutions`_ designed to help educators, +mentors, and developers create and manage automated learning paths. + +.. _AvaCode Solutions: https://avacodesolutions.com/ + +Unlike traditional Learning Management Systems (LMS) that require students +to log into a complex dashboard to find their content, Django Email Learning delivers +lessons directly to the learner's inbox, ensuring high engagement where users +already spend their time. + + +Key Features +------------ + +* **Course Orchestration:** Easily define a sequence of lessons, quizzes, and assignments. +* **Email-First Delivery:** Lessons are delivered via automated email triggers based on learner progress. +* **Enrollment Pages:** Built-in public pages for learner registration. +* **Progress Tracking:** Real-time analytics on lesson sent, quiz completions, and learner bottlenecks. +* **Django Native:** Built as a pluggable Django app that integrates seamlessly into your existing project. + +.. important:: + The library is currently in its early stages of development. The current version is an alpha release, + and while it includes core features, it may not yet be suitable for production use and future updates may introduce breaking changes. + + +How It Works +------------ + +The platform follows a simple three-step lifecycle: + +1. **Design:** You define your Organizations, Courses, Lessons, and Quizzes in the platform section. +2. **Enroll:** Learners join via a public-facing enrollment page. They need to provide their email to start. +3. **Automate:** A background worker (Cron Job) monitors the schedule and sends the next piece of content to the learner's email. + +Who Is This For? +---------------- + +* **Developers:** Looking to add "drip-feed" educational content to an existing Django site. +* **Content Creators:** Who want a lightweight, "distraction-free" way to teach their audience. +* **Bootcamps & Organizations:** Needing a way to automate onboarding or training without forcing users to learn a new UI. + +The Philosophy +-------------- + +Most Learning Management Systems (LMS) suffer from **"Dashboard Fatigue"**—learners sign up with high intent but rarely log back in. Furthermore, traditional web-based platforms often exclude learners in regions with unstable internet connections or limited data access. + +**Django Email Learning** was built to solve these challenges by meeting learners where they already are: their **inbox**. + + +By shifting the delivery from a heavy web interface to lightweight, automated email triggers, we provide: + +* **Offline Access:** Once an email is received, the lesson content is available to the learner regardless of their current connectivity. +* **Reduced Friction:** No need to remember passwords or navigate a complex UI; the content comes to the user. +* **Consistency:** By combining Django’s robust database logic with automated scheduling, we transform learning from a "destination" they have to visit into a passive, consistent habit. + +Next Steps +---------- + +* To get started with a new installation, head over to the :doc:`installation` guide. diff --git a/docs/source/platform/courses.rst b/docs/source/platform/courses.rst new file mode 100644 index 00000000..4fa548c0 --- /dev/null +++ b/docs/source/platform/courses.rst @@ -0,0 +1,202 @@ +Course Management +================= + +The Course Management section is the heart of Django Email Learning, where you create, organize, and manage your educational content. This comprehensive interface allows you to build structured learning experiences that are delivered to learners via email over time. + +Overview +-------- + +The course management page displays all courses within your selected organization. You can switch between organizations using the sidebar if you have access to multiple organizations with appropriate permissions. + +.. image:: ../../images/courses-table.png + :alt: Courses List Interface + :align: center + +Course List Features +~~~~~~~~~~~~~~~~~~~~ + +The courses table provides an overview of all your courses with the following information: + +- **Course Title**: Click to access the course detail page +- **Slug**: URL-friendly identifier used in public enrollment pages +- **Status**: Shows whether the course is enabled (visible for enrollment) or disabled +- **Actions**: Edit, enable/disable, and delete course options + +Clicking on any course name navigates to the course detail page where you can manage lessons, quizzes, content ordering, and delivery scheduling. + +Creating a New Course +--------------------- + +To create a new course: + +1. Click the **"Add Course"** button at the top of the courses list +2. Fill out the course creation form with the required information +3. Save to create your course foundation + +.. image:: ../../images/add-course-form.png + :alt: Add Course Form Interface + :align: center + +Course Fields +~~~~~~~~~~~~~ + +**Title** (Required) + The display name of your course. This appears to learners in enrollment pages and email communications. + +**Description** (Required) + A comprehensive overview of what the course covers, learning objectives, and what learners can expect. This description is shown on public enrollment pages. + +**Slug** (Required) + A URL-friendly identifier that must be unique within your organization. This is used in enrollment URLs and should be descriptive but concise (e.g., "intro-python-programming"). + +**IMAP Connection** (Optional) + Currently not utilized by the platform but reserved for future. You may leave this blank for now. + +.. note:: + **Future Feature**: The IMAP connection field will be used in upcoming releases to provide email based command operations. You can safely ignore this field for the current version. + +Course Status Management +------------------------ + +Courses have two states that control their visibility and enrollment availability: + +**Enabled Courses** + - Visible on public organization pages + - Allow new learner enrollments + - Continue delivering content to existing enrollments + +**Disabled Courses** + - Hidden from public enrollment pages + - Block new enrollments + - Will continue serving existing enrollments + +Use the toggle switch in the courses table to quickly enable or disable courses as needed. + +Managing Course Content +----------------------- + +Once your course is created, navigate to the course detail page to build your learning experience with lessons and quizzes. + +.. image:: ../../images/course-contents-list.png + :alt: Course Detail Interface + :align: center + +Content Types +~~~~~~~~~~~~~ + +**Lessons** + Educational content delivered via email, including text, instructions, exercises, and learning materials. + +**Quizzes** + Interactive assessments that test learner comprehension and progress, with automatic scoring and progress tracking. + +Content Management Actions +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Adding Content** + - Click **"Add Lesson"** to create educational content + - Click **"Add Quiz"** to create assessments + - Each piece of content can be scheduled for delayed delivery + +**Organizing Content** + - Use drag-and-drop interface to reorder content + - Content order determines delivery sequence + - Consider learning progression and difficulty curve + +**Scheduling Delivery** + - Set delays (in days) between content pieces + - Allow time for learner reflection and practice + - Balance engagement with overwhelming frequency + +Creating Lessons +---------------- + +Lessons form the core educational content of your courses. To create a lesson: + +1. Navigate to the course detail page +2. Click **"Add Lesson"** +3. Configure lesson properties and content + +Lesson Configuration +~~~~~~~~~~~~~~~~~~~~~ + +**Title** + Clear, descriptive lesson name that indicates the learning focus + +**Content** + The main educational material delivered to learners. Can include: + - Text-based instruction and explanations + - Exercises and practice activities + - Reading assignments and resources + - Code examples or case studies + +**Delivery Delay** + Time delay (in days) after the previous content before this lesson is sent. Consider: + - Learner processing time + - Content complexity + - Practice and reflection needs + +Creating Quizzes +---------------- + +Quizzes provide assessment and engagement opportunities within your courses. They help measure learner progress and reinforce key concepts. + +.. image:: ../../images/add-quiz-form.png + :alt: Add Quiz Form Interface + :align: center + +Quiz Configuration +~~~~~~~~~~~~~~~~~~ + +**Basic Settings** + +**Title** + Descriptive name for the quiz that indicates the assessment focus + +**Questions and Answers** + - Add multiple-choice questions with various answer options + - Select one or more correct answers per question + - At least one correct answer must be specified for each question + - Support for multiple correct answers per question + +**Delivery Settings** + +**Waiting Period** + Delay time before the quiz is sent to learners: + - Can be specified in days or hours + - Consider content absorption time + - Balance with course pacing + +**Assessment Criteria** + +**Passing Score** + Minimum score (percentage) required to pass the quiz: + - Learners must achieve this score to continue + - Failed attempts allow retakes (up to 2 total attempts) + - After 2 failed attempts, enrollment is deactivated + +**Selection Strategy** + Choose how questions are presented to learners: + + **All Questions** + - Every learner receives the same questions + - Consistent assessment experience + - Suitable for standardized learning objectives + + **Random Questions** + - Different question sets for each learner + - Reduces cheating opportunities + - Provides variety in retake attempts + - **Requirement**: Quiz must have at least 6 questions + +**Deadline** (Future Feature) + Time limit (in days) for quiz completion: + - Currently not enforced by the platform + - Reserved for future release functionality + - Plan your quiz timing accordingly + +.. note:: + **Quiz Attempts**: Learners have up to 2 attempts to pass each quiz. If they fail both attempts, their enrollment is automatically deactivated to maintain course quality standards. + +.. warning:: + **Random Selection Requirements**: When using random question selection, ensure your course has at least 6 questions to provide sufficient variety for different learners and retake scenarios. diff --git a/docs/source/platform/learners.rst b/docs/source/platform/learners.rst new file mode 100644 index 00000000..e80e3e0b --- /dev/null +++ b/docs/source/platform/learners.rst @@ -0,0 +1,35 @@ +Learner Management +================== + +Overview +-------- + +The learners section is accessible to users with appropriate permissions and allows you to: + +- View all learners enrolled in your organization's courses +- Search and filter learners by email +- Monitor individual progress and performance + + +Learner Discovery +----------------- + +**Search Functionality** + Use the search bar to quickly find learners by email address. This is particularly useful for large organizations with many enrolled learners. + + +Individual Learner Details +-------------------------- + +Clicking on any learner's email address opens a detailed view providing comprehensive information about their learning journey. + + +**Course-Specific Progress** + For each enrolled course, you can access: + - **Content Progress**: Which lessons have been delivered and viewed + - **Quiz Performance**: Scores, attempts, and completion status + - **Timeline View**: Chronological learning activity + +.. image:: ../../images/learner-progress.png + :alt: Learner Management Interface + :align: center diff --git a/docs/source/platform/organizations.rst b/docs/source/platform/organizations.rst new file mode 100644 index 00000000..adaa88d4 --- /dev/null +++ b/docs/source/platform/organizations.rst @@ -0,0 +1,145 @@ +Organizations +============= + +Organizations are the top-level containers in Django Email Learning that group courses, learners, and users together. This section provides comprehensive management of organizational structures within your learning platform. + +Overview +-------- + +The Organizations section is accessible via the platform interface at ``/email-learning/platform/organizations/``. This area allows platform administrators to create and manage different organizations, each with their own isolated set of courses, content, and user permissions. + +.. image:: ../../images/organizations.png + :alt: Organizations Management Interface + :align: center + +Use Cases +--------- + +Organizations are particularly useful for: + +**Educational Institutions** + Create separate organizations for different departments, schools, or campuses, each managing their own curriculum and learners. + +**Corporate Training** + Set up organizations for different business units, subsidiaries, or regional offices, allowing decentralized course management. + +**Multi-Tenant Platforms** + Provide completely isolated learning environments for different clients or customers. + + +Default Organization +-------------------- + +When Django Email Learning is first installed, a default organization called "My Organization" is automatically created. This ensures you can immediately start creating courses without additional setup. + +You can: +- Rename this default organization to match your needs +- Use it as your primary organization +- Create additional organizations as your platform grows + +Creating Organizations +---------------------- + +To create a new organization: + +1. Navigate to the Organizations section +2. Click the "Add Organization" button +3. Fill in the required information: + - **Name**: The organization's display name + - **Description**: A detailed description of the organization's purpose + - **Logo**: Upload a logo image (optional) + +.. note:: + Ensure your Django ``MEDIA_ROOT`` and ``MEDIA_URL`` settings are properly configured to handle logo uploads. + +Managing Organizations +---------------------- + +.. image:: ../../images/edit-organization.png + :alt: Organization Edit Interface + :align: center + +Organization Details +~~~~~~~~~~~~~~~~~~~~ + +When editing an organization, you can modify: + +**Basic Information** + - Organization name and description + - Logo image (supported formats: JPG, PNG, GIF) + + +Organization Actions +~~~~~~~~~~~~~~~~~~~~ + +Each organization in the table displays three action icons: + +.. list-table:: Organization Actions + :widths: 10 20 70 + :header-rows: 1 + + * - Icon + - Action + - Description + * - 🌐 Globe + - **Public View** + - Opens the organization's public enrollment page where learners can discover and enroll in available courses. This page is accessible without authentication. + * - ✏️ Edit + - **Edit Organization** + - Opens the organization edit form where you can modify name, description, logo, and other settings. + * - 🗑️ Delete + - **Delete Organization** + - Permanently removes the organization and ALL associated data including courses, learners, enrollments, and content. This action cannot be undone. + +.. warning:: + **Deletion is Permanent**: Deleting an organization removes all associated courses, learner data, enrollments, and content. Ensure you have backups before proceeding with deletion. + +Organization Users and Roles +---------------------------- + +Organizations support role-based access control with three permission levels: + +**Admin Role** + - Full access to all organization features + - Can create, edit, and delete courses + - Manage learners and enrollments + - Modify organization settings + - Assign roles to other users + +**Editor Role** + - Create and modify courses + - Manage course content and lessons + - View and manage learner enrollments + - Cannot modify organization settings or user roles + +**Viewer Role** + - Read-only access to courses and learner data + - Can view reports and analytics + - Cannot create or modify any content + - Cannot access organization settings + +Assigning User Roles +~~~~~~~~~~~~~~~~~~~~ + +Organization users are currently managed through the Django admin panel: + +1. Access Django Admin at ``/admin/`` +2. Navigate to **Django Email Learning > Organization Users** +3. Create a new Organization User entry +4. Select the user, organization, and assign appropriate role + +.. note:: + Future versions will include a user-friendly interface for managing organization users directly from the platform. + +Public Organization Pages +------------------------- + +Each organization has a public page accessible at: + +``/email-learning/public/organization//`` + +This page: +- Lists all publicly available courses for the organization +- Allows anonymous users to enroll in courses +- Displays organization branding (name, logo, description) +- Provides course enrollment forms and information diff --git a/docs/source/technical/management-commands.rst b/docs/source/technical/management-commands.rst new file mode 100644 index 00000000..8c745914 --- /dev/null +++ b/docs/source/technical/management-commands.rst @@ -0,0 +1,44 @@ +Management Commands +=================== + +Django Email Learning provides management commands to handle automated tasks required for course delivery and maintenance. + +deliver_contents Command +------------------------ + +The ``deliver_contents`` management command processes and delivers scheduled course content to enrolled learners via email. + +Usage +~~~~~ + +.. code-block:: bash + + python manage.py deliver_contents + +Function +~~~~~~~~ + +This command: + +- Identifies content scheduled for delivery based on enrollment dates and configured delays +- Sends lessons and quizzes to learners at the appropriate time +- Updates delivery status and tracking information + +Scheduling Requirement +---------------------- + +The ``deliver_contents`` command must be executed regularly to ensure timely content delivery. It should be scheduled to run automatically using a task scheduler. + +.. note:: + The current version does not have an endpoint to trigger this command, so for this MVP version, you will need to set up a cron job or similar scheduling mechanism manually. + For future versions, we plan to introduce an HTTP endpoint to trigger this command. which can be used by webhooks or other services to initiate content delivery without relying solely on cron jobs. + +Execution Frequency +------------------- + +**Recommended Schedule**: Every 15-60 minutes depending on your course delivery requirements. + +**Considerations**: +- More frequent execution provides better delivery timing precision +- Less frequent execution reduces server resource usage +- Consider your learner time zones and expected engagement patterns diff --git a/pyproject.toml b/pyproject.toml index 0fedbd87..7725b386 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,6 +72,7 @@ disallow_incomplete_defs = true warn_unreachable = true exclude = [ "tests/", + "docs/", ] plugins = [ "mypy_django_plugin.main"