Reusable application for Django to ease sign up & sign in processes
BSD-3-CLAUSE License
http://github.com/idlesign/django-sitegate
.. image:: https://img.shields.io/pypi/v/django-sitegate.svg :target: https://pypi.python.org/pypi/django-sitegate
.. image:: https://img.shields.io/pypi/l/django-sitegate.svg :target: https://pypi.python.org/pypi/django-sitegate
.. image:: https://img.shields.io/coveralls/idlesign/django-sitegate/master.svg :target: https://coveralls.io/r/idlesign/django-sitegate
django-sitegate is a reusable application for Django to ease sign up & sign in processes.
This application will handle most common user registration and log in flows for you.
Sign in
Sign up
Here follows the most straightforward way possible with django-sitegate
to have both sign up & sign in
functionality on your page.
Use sitegate_view
decorator to mark your view as the one handling both signups and signins:
.. code-block:: python
from django.shortcuts import render
from sitegate.toolbox import sitegate_view
@sitegate_view # This also prevents logged in users from accessing our sign in/sign up page.
def entrance(request):
return render(request, 'entrance.html', {'title': 'Sign in & Sign up'})
Then in your template load sitegate
tag library and put sitegate_signup_form
& sitegate_signin_form
tags
in place where you want a registration and sign in forms to be.
.. code-block:: html
{% extends "_base.html" %}
{% load sitegate %}
{% block page_contents %}
<div class="my_signin_block">
{% sitegate_signin_form %}
</div>
<div class="my_signup_block">
{% sitegate_signup_form %}
</div>
{% endblock %}
You're done. Now your site visitors have an e-mail + password form to register and username/e-mail + password form to log in.
And mind that we've barely made a scratch of sitegate. Read the docs.