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

Download files

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

Source Distribution

wagtail_subscriptions-0.1.2.tar.gz (65.6 kB view details)

Uploaded Source

Built Distribution

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

wagtail_subscriptions-0.1.2-py3-none-any.whl (93.4 kB view details)

Uploaded Python 3

File details

Details for the file wagtail_subscriptions-0.1.2.tar.gz.

File metadata

  • Download URL: wagtail_subscriptions-0.1.2.tar.gz
  • Upload date:
  • Size: 65.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.16

File hashes

Hashes for wagtail_subscriptions-0.1.2.tar.gz
Algorithm Hash digest
SHA256 15d68ae47b53dfe447bb4ee4624463791c7292fea5528765222fa4e6a31550f9
MD5 fb52b028f4ef6427314356c1517d8996
BLAKE2b-256 11cd647f13c0ad44940fc27284b8a1eff5b6d3d0eb16c55c92a7898494901efa

See more details on using hashes here.

File details

Details for the file wagtail_subscriptions-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for wagtail_subscriptions-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c3fa89b238259705d90dc5073c3292cb1cc024ce290866bd34d36d13ef0d98d
MD5 349c43e4e56beaf7d518b286f62faab4
BLAKE2b-256 16493c99cf75e01ad4aa311e8ae685f9cbc66d848f7a915cfb4974de562035e2

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 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