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.4.tar.gz
(3.9 kB
view details)
File details
Details for the file django-goncord-0.2.4.tar.gz
.
File metadata
- Download URL: django-goncord-0.2.4.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 594b1c283fd05593ad96e0a97b6d0d717ee0b3c49b8df04bdfe2de68a1e4c44d |
|
MD5 | ef3ec0e338b4199e59f8ae0f9cb322d8 |
|
BLAKE2b-256 | e4c69c84e9c43705190c3842d3feca2a4c8cc3e01c398c867718f7f5f5dc6428 |