-
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
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"
curl -XPOST 'http://localhost:8000/saas/login' -d '{"email": "[email protected]", "password": "pleasepass"}' -H "Content-type: application/json"
curl -XPOST 'http://localhost:8000/saas/passwd/reset' -d '{"email": "[email protected]"}' -H "Content-type: application/json"
curl -XPOST 'http://localhost:8000/saas/passwd/reset/cnfrm' -d '{"activation_key": "<activation_key>", "password1": "sankalp", "password2": "sankalp"}' -H "Content-type: application/json"
curl -XGET 'http://localhost:8000/saas/me' -H "Authorization: Token <token>"
curl -XPOST 'http://localhost:8000/saas/invite' -H "Authorization: Token 534fe89f5d6b9ff214e8883d7b9664177002056a" -H "Content-Type: application/json" -d '{"email": "[email protected]"}'
curl -XGET 'http://localhost:8000/saas/signup/prefill?key=<activation_key>'
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
pip install git+https://github.com/sankalpjonn/simple-saas
INSTALLED_APPS = [
'saas',
'rest_framework.authtoken',
'rest_framework',
]
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
),
}
python manage.py migrate
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')),
]