Skip to main content
Django Multiple Auth
====================

django-multiple-auth allows you to login over a Django website with
many users and quickly switch without having to type credentials.


[![Build Status](https://travis-ci.org/EngageSports/django-multiple-auth.svg?branch=master)](https://travis-ci.org/EngageSports/django-multiple-auth)


Requirements
------------

- Django 1.10.* / Django 1.11.*
- Tested under python 2.7 and 3.6


Install
-------

```
pip install django-multiple-auth
```


Add `multiple_auth` to INSTALLED_APPS

```python
INSTALLED_APPS = (
...
'multiple_auth',
)
```

then update your project's `urls.py`:

```python
urlpatterns = patterns(
...
url(r'^m_auth/', include('multiple_auth.urls')),
)
```

Usage
-----

Replace the usage of `django.contrib.auth.views.login` by `multiple_auth.views.login`

```python
from multiple_auth.views import login

urlpatterns = patterns(
url(r'^login/$', login, name='auth_login'),
]
```

This view must be used to login new users, including the first login.


In your template, load the template tag, show a list of logged-in users and give access to the login form.

```html
{% load multiple_auth_tags %}

{% block content %}
{% get_logged_in_users as logged_in_users %}
<ul>
{% for u in logged_in_users %}
<li>
{% if u != request.user %}
<b>{{ u.username }}</b> - {{ u.get_full_name }}
{% else %}
<a href="{% url "multiauth_switch" forloop.counter0 %}">
<b>{{ u.username }}</b> - {{ u.get_full_name }}
</a>
{% endif %}
</li>
{% endfor %}
</ul>
<a href="{% url "multiauth_login" %}">Add account</a>
{% endblock content %}
```




ChangeLog
=========


1.2 2017-12-18
--------------

- Added MANIFEST


1.1 2017-11-30
--------------

- Python 3 compat
- Updated readme
- Test under django 1.10.X, 1.11.X


1.0 2017-11-28
--------------

- Initial Release

Release files for django-multiple-auth 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-multiple-auth 1.2
File Size Uploaded
django-multiple-auth-1.2.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-multiple-auth 1.2
File Interpreter ABI Platform
django_multiple_auth-1.2-py2-none-any.whl Python 2 none any Details

Total release size: 15.7 kB

Release files / django-multiple-auth-1.2.tar.gz

Download URL django-multiple-auth-1.2.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ae572c07c58eb34fca65608e9c374c2a0cb4ca85d8d18c00157c0534c9af553d
BLAKE2b-256 checksum
How to use checksums
a35b334287fe135e546d50f5901f0c16bd72e718ccb18973ae7c90b470facc16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_multiple_auth-1.2-py2-none-any.whl

Download URL django_multiple_auth-1.2-py2-none-any.whl
Size 9.6 kB
Tags Python 2
SHA-256 checksum
How to use checksums
a8bece6d4e23d58322f06ed761006b4943e5cf32462b7538b82f6bded87ea7ff
BLAKE2b-256 checksum
How to use checksums
10e4e1d5ed47a467bee993ee3a56024a9de8b3cbbdfcf06e432f04475a8769d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.2 This release

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page