Multiple login users at the same time
Project description
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.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
====================
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.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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django_multiple_auth-1.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 456f646292bbbc37ffd0a9898080c58d4a439262c3364d503c2f4c733365888a |
|
MD5 | 9ac57aa7c7930c91bf47f0a5e71bae28 |
|
BLAKE2b-256 | 66590600b7fa61cc08dda8322e92411d87e81aeb3899d8f2d728886374746c5f |