Wagtail Subscriptions
A comprehensive subscription management system for Wagtail CMS that provides everything you need to build a SaaS application with subscription billing.
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
- Go to Wagtail Admin → Subscriptions → Plans
- Create your subscription plans with pricing
- Add modules and features
- 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
- Create Stripe account
- Get API keys from dashboard
- Add webhook endpoint:
/subscriptions/webhooks/stripe/ - Configure in Django settings
Paddle Setup
- Create Paddle account
- Get Vendor ID and Auth Code
- Configure webhook URL
- 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
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- 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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wagtail_subscriptions-0.1.2.tar.gz | 65.6 kB | Without provenance | Details for wagtail_subscriptions-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wagtail_subscriptions-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for wagtail_subscriptions-0.1.2-py3-none-any.whl |
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
|
Security for wagtail-subscriptions 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.