Skip to main content

Wagtail Subscriptions

Wagtail Subscriptions Banner

PyPI version Django Packages Documentation Status Python Version Django Version Wagtail Version License

A comprehensive subscription management system for Wagtail CMS that provides everything you need to build a SaaS application with subscription billing.

📚 Read the full documentation

Features

🚀 Complete Subscription Management

  • Multiple subscription plans with flexible billing periods
  • Feature-based access control
  • Trial periods and plan upgrades
  • Customer portal and billing management
  • Multi-tenant support (auto-detects django-tenant-schemas)

💳 Payment Integration

  • Stripe integration (built-in)
  • Paddle support
  • PayPal integration
  • Extensible payment processor architecture

🎛️ Admin Dashboard

  • Beautiful Wagtail-integrated admin interface
  • Plan and feature management
  • Customer overview and analytics
  • Payment processor configuration
  • Tenant-aware permissions (works in both single/multi-tenant modes)

🎨 Frontend Components

  • Responsive pricing tables
  • Modern UI with Tailwind CSS
  • Customizable templates
  • Template tags for easy integration

Quick Start

Installation

pip install wagtail-subscriptions

Settings

Add to your INSTALLED_APPS:

INSTALLED_APPS = [
    # ... your apps
    'wagtail_subscriptions',
]

Configure payment processors:

WAGTAIL_SUBSCRIPTIONS = {
    'PAYMENT_PROCESSORS': {
        'stripe': {
            'public_key': 'pk_test_...',
            'secret_key': 'sk_test_...',
            'webhook_secret': 'whsec_...',
        }
    }
}

URLs

from django.urls import path, include

urlpatterns = [
    # ... your URLs
    path('subscriptions/', include('wagtail_subscriptions.urls')),
]

Migrate

python manage.py migrate
python manage.py setup_subscription_permissions

Usage

Create Subscription Plans

  1. Go to Wagtail Admin → Subscriptions → Plans
  2. Create your subscription plans with pricing
  3. Add modules and features
  4. Associate features with plans

Display Pricing

Use the built-in template tag:

{% load subscription_tags %}
{% price_table %}

Protect Views

from wagtail_subscriptions.permissions.decorators import subscription_required, feature_required

@subscription_required
def my_view(request):
    return render(request, 'my_template.html')

@feature_required('advanced_analytics')
def analytics_view(request):
    return render(request, 'analytics.html')

Check Permissions in Templates

{% load subscription_tags %}

<!-- Works in both single-tenant and multi-tenant modes -->
{% if request|has_feature:'api_access' %}
    <a href="/api/">API Documentation</a>
{% endif %}

<!-- Get subscription info -->
{% subscription_info as sub_info %}
<p>Current Plan: {{ sub_info.plan }}</p>
<p>Subscriber: {{ sub_info.name }} ({{ sub_info.type }})</p>

Documentation

Models

  • SubscriptionPlan: Define pricing and billing periods
  • Module: Organize features into logical groups
  • Feature: Individual features with quota support
  • PlanFeature: Associate features with plans
  • Subscription: User subscriptions and billing
  • Customer: Extended customer information

Payment Processors

Stripe Setup

  1. Create Stripe account
  2. Get API keys from dashboard
  3. Add webhook endpoint: /subscriptions/webhooks/stripe/
  4. Configure in Django settings

Paddle Setup

  1. Create Paddle account
  2. Get Vendor ID and Auth Code
  3. Configure webhook URL
  4. Add to Django settings

Template Tags

{% load subscription_tags %}

<!-- Basic pricing table -->
{% price_table %}

<!-- Custom options -->
{% price_table show_trial=False highlight_plan="pro" %}

<!-- Check feature access -->
{% if subscription|has_feature:"advanced_reports" %}
    <!-- Feature content -->
{% endif %}

Management Commands

# Set up permissions
python manage.py setup_subscription_permissions

# Create sample data
python manage.py create_sample_plans

# Sync tenant plans (for multi-tenant setups)
python manage.py sync_tenant_plans

API Reference

Subscription Model Methods

subscription = request.user.subscriptions.first()

# Check feature access
subscription.has_feature_access('feature_slug')

# Get feature quota
subscription.get_feature_quota('feature_slug')

# Check if active
subscription.is_active

# Check if in trial
subscription.is_trial

Permission Mixins

from wagtail_subscriptions.permissions.mixins import (
    SubscriptionRequiredMixin, 
    FeatureRequiredMixin
)

# Works automatically in both single-tenant and multi-tenant modes
class MyView(FeatureRequiredMixin, TemplateView):
    required_feature = 'advanced_analytics'
    template_name = 'my_template.html'

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

Metadata

Release files for wagtail-subscriptions 0.1.2

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

Source distribution (sdist)

Source distribution for wagtail-subscriptions 0.1.2
File Size Uploaded
wagtail_subscriptions-0.1.2.tar.gz 65.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wagtail-subscriptions 0.1.2
File Interpreter ABI Platform
wagtail_subscriptions-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 159.0 kB

Release files / wagtail_subscriptions-0.1.2.tar.gz

Download URL wagtail_subscriptions-0.1.2.tar.gz
Size 65.6 kB
Tags Source
SHA-256 checksum
How to use checksums
15d68ae47b53dfe447bb4ee4624463791c7292fea5528765222fa4e6a31550f9
BLAKE2b-256 checksum
How to use checksums
11cd647f13c0ad44940fc27284b8a1eff5b6d3d0eb16c55c92a7898494901efa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / wagtail_subscriptions-0.1.2-py3-none-any.whl

Download URL wagtail_subscriptions-0.1.2-py3-none-any.whl
Size 93.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c3fa89b238259705d90dc5073c3292cb1cc024ce290866bd34d36d13ef0d98d
BLAKE2b-256 checksum
How to use checksums
16493c99cf75e01ad4aa311e8ae685f9cbc66d848f7a915cfb4974de562035e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release 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