Getting Started

Get the distribution

Install dj-paddle:

pip install dj-paddle


Add djpaddle to your INSTALLED_APPS:


Add to

path("paddle/", include("djpaddle.urls", namespace="djpaddle")),

Tell paddle about the webhook (paddle webhook docs can be found here) using the full URL of your endpoint from the step above (e.g.

Add your paddle keys and set the operating mode:

# can be found at
DJPADDLE_VENDOR_ID = '<your-vendor-id>'

# create one at
DJPADDLE_API_KEY = '<your-api-key>'

# can be found at
DJPADDLE_PUBLIC_KEY = '<your-public-key>'

djpaddle includes vendor_id template context processor which adds your vendor ID as DJPADDLE_VENDOR_ID to each template context

    'OPTIONS': {
        'context_processors': [

Run the commands:

python migrate

# fetches all subscription plans from paddle
python djpaddle_sync_plans_from_paddle

Paddle Checkout

Next to setup a PaddleJS checkout page

First load in PaddleJS and initialise it by including the dj-paddle PaddleJS template in your own template to load PaddleJS:

{% include "djpaddle_paddlejs.html" %}

Next add a Paddle product or subscription plan into the page context. Below is an example of how to do this using a class based view where plan_id is passed through as a value from the URL

from django.conf import settings
from django.views.generic import TemplateView

from djpaddle.models import Plan

class Checkout(TemplateView):
    template_name = 'checkout.html'

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)

        context['paddle_plan'] = Plan.objects.get(pk=kwargs['plan_id'])
        # If you have not added 'djpaddle.context_processors.vendor_id' as a template context processors
        context['DJPADDLE_VENDOR_ID'] = settings.DJPADDLE_VENDOR_ID

        return context

Finally put a Buy Now! button for the plan subscription you added to the context

<a href="#!" class="paddle_button" data-product="{{ }}">Buy Now!</a>

Clicking this button will kick off the Paddle checkout process.