Git Product home page Git Product logo

djaodjin-saas's Introduction

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

Tested with

  • Python: 2.7, Django: 1.11 (LTS), Django Rest Framework: 3.9.4
  • Python: 3.6, Django: 1.11 (LTS), Django Rest Framework: 3.9.4
  • Python: 3.6, Django: 2.2 (latest, LTS), Django Rest Framework: 3.9.4

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

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

0.8.4

  • claims organization with no roles based on e-mail address
  • fixes implicit role grants

previous release notes

djaodjin-saas's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.