Giter Club home page Giter Club logo

simple-saas's Introduction

simple-saas

  • This django project is meant to serve as a boilerplate code for building any saas tool

  • The directory saas serves as a django app with all the boilerplate code

  • django-rest-framework is used for authentication and creating apis. Please refer to this if not familiar with django-rest-framework since this project heavily relies on it.

  • business logic for all APIs is present in serializers.

  • to use this as a library, refer to this

Signup

curl -XPOST 'http://localhost:8000/saas/signup' -d '{"business": {"name": "test inc"}, "email": "[email protected]", "first_name": "sankalp", "last_name": "jonna", "password1": "pleasepass", "password2": "pleasepass"}' -H "Content-type: application/json"

Login

curl -XPOST 'http://localhost:8000/saas/login' -d '{"email": "[email protected]", "password": "pleasepass"}' -H "Content-type: application/json"

Reset password

curl -XPOST 'http://localhost:8000/saas/passwd/reset' -d '{"email": "[email protected]"}' -H "Content-type: application/json"

Reset password confirmation

curl -XPOST 'http://localhost:8000/saas/passwd/reset/cnfrm' -d '{"activation_key": "<activation_key>", "password1": "sankalp", "password2": "sankalp"}' -H "Content-type: application/json"

Me

curl -XGET 'http://localhost:8000/saas/me' -H "Authorization: Token <token>"

Invite

curl -XPOST 'http://localhost:8000/saas/invite' -H "Authorization: Token 534fe89f5d6b9ff214e8883d7b9664177002056a" -H "Content-Type: application/json" -d '{"email": "[email protected]"}'

Prefill Signup form

curl -XGET 'http://localhost:8000/saas/signup/prefill?key=<activation_key>'

Using as a library

If you feel that the current functionality is enough and you wish to simply use the saas app in your existing django project, follow these steps

Installation

pip install git+https://github.com/sankalpjonn/simple-saas

add saas and rest_framework to INSTALLED_APPS

INSTALLED_APPS = [
	'saas',

	'rest_framework.authtoken',
	'rest_framework',
]

add rest_framework settings

REST_FRAMEWORK = {
	'DEFAULT_AUTHENTICATION_CLASSES': (
		'rest_framework.authentication.TokenAuthentication',
	),
}

run migrations

python manage.py migrate

add to urls.py

in the root urls, add

urlpatterns = [
	url(r'^', include('django.contrib.auth.urls')),
	url(r'^admin/', admin.site.urls),
    url(r'^saas/', include('saas.urls')),
]

simple-saas's People

Contributors

sankalpjonn 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.