A django widget which allows you to create multiple auth system.
Project description
# django-goncord
Django auth system.
Tested with Django 1.10.4 and Python 3.5.
## Installation guide
First install package using pip
```sh
pip install django-goncord
```
After installation register middleware and authentication backend in settings
```python
MIDDLEWARE_CLASSES = [
...
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django_goncord.middleware.GoncordMiddleware',
...
]
...
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.RemoteUserBackend',
]
```
Then register auth system url parameters in settings
```python
GONCORD = {
'BASE_URL': 'URL like http://www.my-site.ru',
}
```
You can define your own authentication urls
```python
GONCORD = {
...
'VALIDATE_URL': 'SUB_URL like /validate',
'LOGIN_URL': 'SUB_URL like /login',
'LOGOUT_URL': 'SUB_URL like /logout',
'REGISTER_URL': 'SUB_URL like /register',
'UPDATE_PAYLOADS_URL': 'SUB_URL like /update',
'RESET_PASSWORD_URL': 'SUB_URL like /reset_password',
...
}
```
at the end specify Django **LOGIN_URL** parameter
for working with package use **login_required** decorator from **django.contrib.auth.decorators**
For using special methods like **login** import **goncord** from **django_goncord.backends**
## django_goncord.backends.goncord methods
### login(request, data)
provide request for authenticate user
> require: django request object and data for submitting to remote server
### logout(request)
provide request for logout user
> require: django request object
### validate(request)
provide token validation for user on remote server
> require: django request object
### register(data)
provide user registration request
> require: data for submitting to remote server
### reset_password(request, data)
provide password reset for authenticated user
> require: django request object and data for submitting to remote server
all methods return response result from remote server
Django auth system.
Tested with Django 1.10.4 and Python 3.5.
## Installation guide
First install package using pip
```sh
pip install django-goncord
```
After installation register middleware and authentication backend in settings
```python
MIDDLEWARE_CLASSES = [
...
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django_goncord.middleware.GoncordMiddleware',
...
]
...
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.RemoteUserBackend',
]
```
Then register auth system url parameters in settings
```python
GONCORD = {
'BASE_URL': 'URL like http://www.my-site.ru',
}
```
You can define your own authentication urls
```python
GONCORD = {
...
'VALIDATE_URL': 'SUB_URL like /validate',
'LOGIN_URL': 'SUB_URL like /login',
'LOGOUT_URL': 'SUB_URL like /logout',
'REGISTER_URL': 'SUB_URL like /register',
'UPDATE_PAYLOADS_URL': 'SUB_URL like /update',
'RESET_PASSWORD_URL': 'SUB_URL like /reset_password',
...
}
```
at the end specify Django **LOGIN_URL** parameter
for working with package use **login_required** decorator from **django.contrib.auth.decorators**
For using special methods like **login** import **goncord** from **django_goncord.backends**
## django_goncord.backends.goncord methods
### login(request, data)
provide request for authenticate user
> require: django request object and data for submitting to remote server
### logout(request)
provide request for logout user
> require: django request object
### validate(request)
provide token validation for user on remote server
> require: django request object
### register(data)
provide user registration request
> require: data for submitting to remote server
### reset_password(request, data)
provide password reset for authenticated user
> require: django request object and data for submitting to remote server
all methods return response result from remote server
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
django-goncord-0.2.6.tar.gz
(3.9 kB
view details)
Built Distribution
File details
Details for the file django-goncord-0.2.6.tar.gz
.
File metadata
- Download URL: django-goncord-0.2.6.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08a142b6349da325b159a63b5074d4d00fa5e33a7487829134f4108cf9741e83 |
|
MD5 | b2101539770fd31bda9ed4fecf39e8f4 |
|
BLAKE2b-256 | 28139fbb131b26793794ee0bd67a189d8df06157db777743cd57c35885802339 |
File details
Details for the file django_goncord-0.2.6-py3-none-any.whl
.
File metadata
- Download URL: django_goncord-0.2.6-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f9786fc48d83032907440fe15288c9ce05093901d5869103b1ebd4b927f36f3 |
|
MD5 | 927bf3759bf24b7ff0bd9a37eb42c3a3 |
|
BLAKE2b-256 | eceef3f25b61dcd943da1885c8b476e528a849091ad3c31d1e7679a05337f98c |