App de Django para manejar cuentas utilizando tokens.
Project description
========
Accounts
========
Accounts es un app de Django que permite el control y manejo de cuentas de usuario por medio del uso de tokens. Utiliza el Django Rest Framework.
Accounts contiene las siguientes funcionalidades:
- Registro de usuario.
- Login y logout.
- Expiracion de tokens.
Inicio rapido
-------------
1. Agrega "accounts" a tus apps instaladas::
INSTALLED_APPS = (
...
'accounts.apps.AccountsConfig',
)
2. Instala Django Rest Framework y agregalo a tus apps instaladas asi::
INSTALLED_APPS = (
...
'rest_framework',
'rest_framework.authtoken'
)
3. Registra el modelo de usuario y el backend de autenticacion en tu archivo settings::
AUTH_USER_MODEL = 'accounts.User'
AUTHENTICATION_BACKENDS = (
'accounts.authentication.CustomAuthenticationBackend'
)
4. Agrega el tiempo de expiracion para los tokens en tu archivo settings::
EXPIRATION_TIME = 24
5. Registra tus clases de permisos y autenticacion para el rest framework, puedes usar algo como esto::
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
),
'DEFAULT_AUTHENTICATION_CLASSES': (
'accounts.authentication.ExpiringTokenAuthentication',
),
'DEFAULT_FILTER_BACKENDS': (
'rest_framework.filters.DjangoFilterBackend',
'rest_framework.filters.SearchFilter'
),
'PAGINATE_BY': 10
}
6. Incluye las urls de accounts en tu proyecto, algo asi::
from accounts import urls as accounts_urls
url(r'^accounts/', include(accounts_urls))
7. Corre las pruebas para aseguranos que el paquete se instalo correctamente::
python3 manage.py test
Accounts
========
Accounts es un app de Django que permite el control y manejo de cuentas de usuario por medio del uso de tokens. Utiliza el Django Rest Framework.
Accounts contiene las siguientes funcionalidades:
- Registro de usuario.
- Login y logout.
- Expiracion de tokens.
Inicio rapido
-------------
1. Agrega "accounts" a tus apps instaladas::
INSTALLED_APPS = (
...
'accounts.apps.AccountsConfig',
)
2. Instala Django Rest Framework y agregalo a tus apps instaladas asi::
INSTALLED_APPS = (
...
'rest_framework',
'rest_framework.authtoken'
)
3. Registra el modelo de usuario y el backend de autenticacion en tu archivo settings::
AUTH_USER_MODEL = 'accounts.User'
AUTHENTICATION_BACKENDS = (
'accounts.authentication.CustomAuthenticationBackend'
)
4. Agrega el tiempo de expiracion para los tokens en tu archivo settings::
EXPIRATION_TIME = 24
5. Registra tus clases de permisos y autenticacion para el rest framework, puedes usar algo como esto::
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
),
'DEFAULT_AUTHENTICATION_CLASSES': (
'accounts.authentication.ExpiringTokenAuthentication',
),
'DEFAULT_FILTER_BACKENDS': (
'rest_framework.filters.DjangoFilterBackend',
'rest_framework.filters.SearchFilter'
),
'PAGINATE_BY': 10
}
6. Incluye las urls de accounts en tu proyecto, algo asi::
from accounts import urls as accounts_urls
url(r'^accounts/', include(accounts_urls))
7. Corre las pruebas para aseguranos que el paquete se instalo correctamente::
python3 manage.py test
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
djangorf-accounts-0.1.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for djangorf_accounts-0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a48e05946ac65e29d80c05769760af7087b8eb635ffe99d44682e7f5eec6cb48 |
|
MD5 | e560dda1037a0abe128cdb5c573e2ff9 |
|
BLAKE2b-256 | 20cab1f10046466f82151c5eb88df10b3fe005090b596dd09f10133143a5fe68 |