https://github.com/djaodjin/djaodjin-saas
Django application for software-as-service and subscription businesses
https://github.com/djaodjin/djaodjin-saas
django plans razorpay saas stripe subscriptions
Last synced: about 1 year ago
JSON representation
Django application for software-as-service and subscription businesses
- Host: GitHub
- URL: https://github.com/djaodjin/djaodjin-saas
- Owner: djaodjin
- License: other
- Created: 2013-05-06T22:43:32.000Z (about 13 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T21:07:59.000Z (about 1 year ago)
- Last Synced: 2025-04-09T22:21:31.178Z (about 1 year ago)
- Topics: django, plans, razorpay, saas, stripe, subscriptions
- Language: Python
- Homepage:
- Size: 6.5 MB
- Stars: 585
- Watchers: 23
- Forks: 129
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: changelog
- License: LICENSE.txt
- Security: docs/security.rst
Awesome Lists containing this project
- starred-awesome - djaodjin-saas - Django application for subscription businesses (Python)
README
DjaoDjin-SaaS
=============
[](https://djaodjin-saas.readthedocs.io/en/latest/?badge=latest)
[](https://badge.fury.io/py/djaodjin-saas)
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](https://github.com/djaodjin/djaoapp/).
Full documentation for the project is available at
[Read-the-Docs](http://djaodjin-saas.readthedocs.org/)
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](http://djaodjin-saas.readthedocs.io/en/latest/backends.html))
and Django secret key into a credentials file. Example with
[Stripe](https://stripe.com/):
$ 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](https://djaodjin-saas.readthedocs.io/en/latest/getting-started.html#setting-up-a-software-as-a-service-site).
$ 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 __old in db schema](http://djaodjin.com/blog/django-2-2-with-sqlite-3-on-centos-7.blog.html#sqlite-django-compatibility) 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.10, **Django:** 4.2 ([LTS](https://www.djangoproject.com/download/))
- **Python:** 3.12, **Django:** 5.1 (next)
- **Python:** 3.7, **Django:** 3.2 (legacy)
1.1.1
* handles edge cases when DEFAULT_FROM_EMAIL is empty or None
* reworks profile redirect view workflow in the presence of various roles
* matches `DELETE /api/cart` for cookies and db
* defines Stripe platform keys vs. Stripe broker keys explicitely
* passes request in context of `product_url`
[previous release notes](changelog)