Skip to main content

A django app to help you manage the django-shopify-app package billing

Project description

django-shopify-app-billing

This is a Django app that provides billing for Shopify apps. It is designed to be used with the Django Shopify App package

Installation

pip install django-shopify-app-billing

Add billing to your INSTALLED_APPS in your Django settings file.

INSTALLED_APPS = [
    ...
    'shopify_app_billing',
    ...
]

Add the following to your Shop model:

from shopify_app_billing.models import ShopBilling
from shopify_app.models import ShopBase


class Shop(ShopBase):
    ...
    billing = models.OneToOneField(ShopBilling, on_delete=models.CASCADE, null=True, blank=True)
    ...

    def save(self, *args, **kwargs):
        if not self.billing:
            self.billing = ShopBilling.objects.create()

        super().save(*args, **kwargs)

    @property
    def plan_activated_redirect_path(self):
        return f"/dashboard"

Project details


Download files

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

Source Distribution

django_shopify_app_billing-0.0.6.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page