Skip to main content

Django application for software-as-service and subscription businesses

Project description

DjaoDjin-SaaS

Documentation Status PyPI version

djaodjin-saas is a Django application that implements the logic to support subscription-based Software-as-a-Service businesses.

Major Features:

  • Separate billing profiles and authenticated users
  • Double entry book keeping ledger
  • Flexible security framework

This project contains bare bone templates which are compatible with Django and Jinja2 template engines. To see djaodjin-saas in action as part of a full-fledged subscription-based session proxy, take a look at djaoapp.

Full documentation for the project is available at Read-the-Docs

Development

After cloning the repository, create a virtualenv environment and install the prerequisites:


    $ python -m venv .venv
    $ source .venv/bin/activate
    $ pip install -r testsite/requirements.txt

    # Installs Javascript prerequisites to run in the browser
    $ make vendor-assets-prerequisites

To use the testsite, you will need to add the payment processor keys (see Processor Backends) and Django secret key into a credentials file. Example with Stripe:


    $ cat ./credentials

    SECRET_KEY = "enough_random_data"
    STRIPE_PUB_KEY = "your_stripe_public_api_key"
    STRIPE_PRIV_KEY = "your_stripe_private_api_key"

It remains to create and populate the database with required objects.

$ python ./manage.py migrate --run-syncdb --noinput
$ python ./manage.py loaddata testsite/fixtures/initial_data.json
$ python ./manage.py createsuperuser

You can further generate a set of dummy data data to populate the site.

$ python ./manage.py load_test_transactions

Side note: If create your own fixtures file (ex: testsite/fixtures/test_data.json) and attempt to load them with a Django version before 2 while the Python executable was linked with a SQLite version after 3.25, you might stumble upon the well-known SQLite 3.26 breaks database migration ForeignKey constraint, leaving <table_name>__old in db schema bug. Your best bet is to use Django2+ or delete the migrations/ directory.

If all is well then, you are ready to run the server and browse the testsite.

$ python manage.py runserver

# Browse http://localhost:8000/

Implementation Notes

The latest versions of django-restframework (>=3.0) implement paginators disconnected from parameters in views (i.e. no more paginate_by). You will thus need to define PAGE_SIZE in your settings.py

$ diff testsite/settings.py
+REST_FRAMEWORK = {
+    'PAGE_SIZE': 25,
+    'DEFAULT_PAGINATION_CLASS':
+        'rest_framework.pagination.PageNumberPagination',
+}

This Django App does not send notification e-mails itself. All major updates that would result in a e-mail sent trigger signals though. It is straightforward to send e-mails on a signal trigger in the main Django project. We provide sample e-mail templates here in the saas/templates/notification/ directory.

Release Notes

Tested with

  • Python: 3.12, Django: 5.2 (LTS)
  • Python: 3.14, Django: 6.0 (next)
  • Python: 3.10, Django: 4.2 (legacy)
  • Python: 3.9, Django: 3.2 (legacy)

1.2.3

  • skips "pay balance" page if balance less than 50 cents
  • raises an appropriate error when attempting to charge less than 50 cents
  • does not show "Remove from cart" for balances due
  • fixes AttributeError in CartItemManager.redeem under certain conditions
  • makes use of pytz optional
  • removes dependency on jQuery in Vue components
  • reconciles subscriptions in database with a spreadsheet

previous release notes

Project details


Release history Release notifications | RSS feed

This version

1.2.3

Download files

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

Source Distribution

djaodjin_saas-1.2.3.tar.gz (330.5 kB view details)

Uploaded Source

Built Distribution

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

djaodjin_saas-1.2.3-py3-none-any.whl (481.9 kB view details)

Uploaded Python 3

File details

Details for the file djaodjin_saas-1.2.3.tar.gz.

File metadata

  • Download URL: djaodjin_saas-1.2.3.tar.gz
  • Upload date:
  • Size: 330.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for djaodjin_saas-1.2.3.tar.gz
Algorithm Hash digest
SHA256 07e95331c4ccd132ddd089c61342e73b6c96cfa3e12e49cd1ea70d93315ea29c
MD5 5934d2e6aa3ef40f3c9045390cdf4095
BLAKE2b-256 3c7815779d4340a8d63321530b32f0cd1d21426a086398c62fd015b7270e1596

See more details on using hashes here.

File details

Details for the file djaodjin_saas-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: djaodjin_saas-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 481.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for djaodjin_saas-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 521adb90e9de44bc385db312728a9e817339114d5c2a197dd001edd12e5507cc
MD5 9e1cfb9dd9a609faa47ecb5f1b423b26
BLAKE2b-256 106ee53d187d5adaf9946f8e9185c04008d0c9fd12dd1711f6071f76f9a8dd53

See more details on using hashes here.

Supported by

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