Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 3, 2025

Overview

This PR adds marketing-focused landing pages for courses at /<course_slug>/about with integrated registration forms. These pages are publicly accessible and provide rich content about courses while allowing prospective students to register for updates.

Key Features

1. Course State Management

Introduced a new CourseState system to replace the simple finished boolean:

  • REGISTRATION: Course is accepting registrations (shows landing page by default)
  • ACTIVE: Course is running (shows course workspace)
  • FINISHED: Course has ended

When a course is in REGISTRATION state, accessing /<course_slug>/ redirects to the landing page, except for superusers who can preview the course workspace.

2. Landing Page (/<course_slug>/about)

Each course can now have a dedicated landing page with:

  • Markdown content (about_content) - Rich course descriptions with formatting, lists, headers, etc.
  • YouTube video embed (video_url) - Course overview videos
  • Hero image (hero_image_url) - Eye-catching banner images
  • SEO optimization - Complete meta tags including Open Graph and Twitter Cards for social sharing

3. Registration System

New CourseRegistration model captures:

  • Email (required, unique per course)
  • Full name (required)
  • Country (required) - Searchable dropdown with 227 countries across 6 regions
  • Role (required) - 9 predefined options:
    • Data Engineer
    • Data Scientist
    • Data Analyst
    • ML Engineer
    • Software Engineer (Backend)
    • Software Engineer (Frontend, Test, etc)
    • Student (STEM)
    • Student (Non-STEM)
    • Other
  • Comment (optional)

The form includes duplicate prevention and automatically determines the region from the selected country.

4. Mailchimp Integration

Automatic newsletter subscription with:

  • Background processing to avoid blocking form submission
  • Course-specific tags for targeted communications
  • Configurable via MAILCHIMP_TOKEN, MAILCHIMP_LIST_ID, and per-course mailchimp_tag
  • Graceful fallback when not configured (logs warning)

5. Admin Interface Updates

Enhanced Django admin with:

  • Course state display in list view
  • Organized fieldsets (Basic Information, Course State, Landing Page Content, Settings)
  • New CourseRegistration admin for viewing and managing registrations
  • Filtering by course, role, country, and registration date

Implementation Details

Models

# Course model additions
class Course(models.Model):
    state = models.CharField(choices=CourseState.CHOICES, default=CourseState.ACTIVE)
    about_content = models.TextField(blank=True)
    video_url = models.URLField(blank=True)
    hero_image_url = models.URLField(blank=True)
    meta_description = models.TextField(blank=True)
    mailchimp_tag = models.CharField(max_length=100, blank=True)

# New model
class CourseRegistration(models.Model):
    course = models.ForeignKey(Course, on_delete=models.CASCADE)
    email = models.EmailField()
    name = models.CharField(max_length=255)
    country = models.CharField(max_length=100)
    region = models.CharField(max_length=100, blank=True)
    role = models.CharField(max_length=50, choices=ROLE_CHOICES)
    comment = models.TextField(blank=True)
    registered_at = models.DateTimeField(auto_now_add=True)
    mailchimp_subscribed = models.BooleanField(default=False)

Views

  • course_landing_view(): Renders the landing page with markdown-to-HTML conversion, YouTube video ID extraction, and registration form handling
  • course_view(): Updated to redirect to landing page when course is in REGISTRATION state (except for superusers)
  • course_list(): Updated to display courses grouped by state (Registration Open, Active, Finished)

Dependencies

Added markdown package for rendering rich content with extra and codehilite extensions.

Testing

17 new tests added in test_landing_page.py covering:

  • Landing page accessibility and content rendering
  • SEO meta tags validation
  • Registration form submission (authenticated and unauthenticated users)
  • Duplicate registration prevention
  • Form validation
  • Course state redirects
  • YouTube URL parsing (both formats: watch?v= and youtu.be/)

All existing tests pass (14 tests in test_course.py) ensuring no regression.

Screenshots

Course List with Registration Section

Course List

The course list now shows courses grouped by state, with "Registration Open" courses displayed prominently at the top.

Landing Page with Rendered Markdown

Landing Page

The landing page displays rich markdown content with proper formatting, headings, lists, and bold text. YouTube videos are embedded, and the registration form is displayed below the content.

Registration Form Filled

Registration Form

The registration form includes all required fields with a searchable country dropdown containing 227 countries.

Registration Success

Registration Success

After successful registration, users see a confirmation message and the form is reset. Registrations are saved to the database and subscribers are added to Mailchimp in the background.

Usage

Setting Up a Course Landing Page

  1. Set the course state to REGISTRATION in the admin
  2. Add markdown content to about_content field
  3. Optionally add a YouTube URL and hero image URL
  4. Set a mailchimp_tag for newsletter segmentation
  5. The landing page will be accessible at /<course_slug>/about
  6. Regular course page redirects to landing page for non-superusers

Viewing Registrations

Access the CourseRegistration admin to:

  • View all registrations with filtering by course, country, role, and date
  • Export registration data
  • Track Mailchimp subscription status

Notes

  • The finished field is kept for backward compatibility but should be deprecated in favor of state
  • Mailchimp integration requires environment variables: MAILCHIMP_TOKEN and MAILCHIMP_LIST_ID
  • Newsletter subscription notice is displayed prominently on the form
  • Country/region mapping is stored as constants in courses/constants.py

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add course landing pages with registration forms to the course management platform</issue_title>
<issue_description># Course Landing Page - Product Specification

Overview

Add marketing-focused landing pages for each course at /<course_slug>/about, separate from the existing course workspace at /<course_slug>/. Both pages are publicly accessible with no forced redirects - keeping things simple and transparent.

Key Design Principles

Simple - No complex authentication/enrollment redirects
Transparent - Everyone can see course content
Clear CTAs - Obvious enrollment prompts for non-enrolled users
Flexible - Users can freely navigate between landing page and workspace

Goals

  1. Create public-facing landing pages for each course (/<course_slug>/about)
  2. Keep existing course workspace functionality (/<course_slug>/)
  3. Make both pages publicly accessible (no redirects)
  4. Provide rich marketing content for prospective students
  5. Make enrollment easy and prominent on landing pages
  6. Keep implementation simple and maintainable

Implementation details

Course state

Instead of "course_finished" create course_state with 3 states: REGISTRATION, ACTIVE, FINISHED
When the course is in the registration state, the click on the course should bring to the sign-up about page (with redirect)
When course is active, should be usual /course/ page
To see the usual course page when the course is in the registration state, users (superuser status) will be able to see the actual course page to check that things look correct

About page

It should contain markdown content for marketing purposes
at the end there's a register form with the following fields:

Email (if signed up, show their email and don't let them change it)

Name

Country

Role
What best describes you?
Data Engineer
Data Scientist
Data Analyst
ML Engineer
Software Engineer (Backend)
Software Engineer (Frontend, Test, etc)
Student (STEM)
Student (Non-STEM)
Other

Comment: Anything you would like to add?

Countries: (don't show the region, but have it in the model)

it should be a dropdown list with possibility to type to see narrowed down list of options

country,region
Algeria,Africa
Angola,Africa
Benin,Africa
Botswana,Africa
Burkina Faso,Africa
Burundi,Africa
Cabo Verde,Africa
Cameroon,Africa
Central African Republic,Africa
Chad,Africa
Comoros,Africa
Congo,Africa
Democratic Republic of the Congo,Africa
Cote d'Ivoire,Africa
Djibouti,Africa
Egypt,Africa
Equatorial Guinea,Africa
Eritrea,Africa
Eswatini,Africa
Ethiopia,Africa
Gabon,Africa
Gambia,Africa
Ghana,Africa
Guinea,Africa
Guinea-Bissau,Africa
Kenya,Africa
Lesotho,Africa
Liberia,Africa
Libya,Africa
Madagascar,Africa
Malawi,Africa
Mali,Africa
Mauritania,Africa
Mauritius,Africa
Morocco,Africa
Mozambique,Africa
Namibia,Africa
Niger,Africa
Nigeria,Africa
Rwanda,Africa
Sao Tome and Principe,Africa
Senegal,Africa
Seychelles,Africa
Sierra Leone,Africa
Somalia,Africa
South Africa,Africa
South Sudan,Africa
Sudan,Africa
Tanzania,Africa
Togo,Africa
Tunisia,Africa
Uganda,Africa
Zambia,Africa
Zimbabwe,Africa
Canada,North America
United States,North America
United States of America,North America
Mexico,North America
Bermuda,North America
Greenland,North America
Saint Pierre and Miquelon,North America
Belize,North America
Costa Rica,North America
El Salvador,North America
Guatemala,North America
Honduras,North America
Nicaragua,North America
Panama,North America
Cuba,North America
Dominican Republic,North America
Haiti,North America
Jamaica,North America
Trinidad and Tobago,North America
Barbados,North America
Bahamas,North America
Grenada,North America
Saint Lucia,North America
Saint Vincent and the Grenadines,North America
Dominica,North America
Antigua and Barbuda,North America
Saint Kitts and Nevis,North America
Puerto Rico,North America
Curacao,North America
Aruba,North America
Cayman Islands,North America
Argentina,South America
Bolivia,South America
Brazil,South America
Chile,South America
Colombia,South America
Ecuador,South America
Guyana,South America
Paraguay,South America
Peru,South America
Suriname,South America
Uruguay,South America
Venezuela,South America
French Guiana,South America
Falkland Islands,South America
Afghanistan,Asia
Armenia,Asia
Azerbaijan,Asia
Bahrain,Asia
Bangladesh,Asia
Bhutan,Asia
Brunei,Asia
Cambodia,Asia
China,Asia
Georgia,Asia
India,Asia
Indonesia,Asia
Iran,Asia
Iraq,Asia
Israel,Asia
Japan,Asia
Jordan,Asia
Kazakhstan,Asia
Kuwait,Asia
Kyrgyzstan,Asia
Laos,Asia
Lebanon,Asia
Malaysia,Asia
Maldives,Asia
Mongolia,Asia
Myanmar,Asia
Nepal,Asia
North Korea,Asia
Oman,Asia
Pakistan,Asia
Palestine,Asia
Philippines,Asia
Qatar,Asia
Saudi Arabia,Asia
Singapore,Asia
South Korea,Asia
Sri Lanka,Asia
Syria,Asia
Tajikistan,Asia
Thailand,Asia
Timor-Leste,Asia
Turkey,Asia
Turkmenistan,Asia
United Arab Emirates,Asia
Uzbekistan,Asia
Vietnam,Asia
Yemen,Asia
Al...

Fixes #92

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Add CourseState model with REGISTRATION, ACTIVE, FINISHED states
- Add CourseRegistration model to track course registrations
- Add course landing page fields (about_content, video_url, hero_image_url, meta_description, mailchimp_tag)
- Implement landing page view at /<course_slug>/about with registration form
- Add registration form with email, name, country dropdown, role, and comment fields
- Implement Mailchimp integration for newsletter subscriptions
- Add SEO meta tags (title, description, Open Graph, Twitter Cards)
- Update course view to redirect to landing page for courses in REGISTRATION state
- Add comprehensive tests for landing page and registration functionality

Co-authored-by: alexeygrigorev <[email protected]>
Copilot AI changed the title [WIP] Add course landing pages with registration forms to the course management platform Add course landing pages with registration forms Oct 3, 2025
Copilot AI requested a review from alexeygrigorev October 3, 2025 10:22
Copilot finished work on behalf of alexeygrigorev October 3, 2025 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add course landing pages with registration forms to the course management platform

2 participants