========
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
========
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
Metadata
Release files for djangorf-accounts 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| djangorf-accounts-1.0.tar.gz | 12.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| djangorf_accounts-1.0-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 35.9 kB
Release files / djangorf-accounts-1.0.tar.gz
| Download URL | djangorf-accounts-1.0.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
411209d20990869b4365dc115f1503923f21eda5e4f31af520d2f272933bddd0
|
|
BLAKE2b-256 checksum How to use checksums |
9884212ca418133c4cd05a7f3abf0b62595b0b3e1a3896164ed3e3810ed926d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / djangorf_accounts-1.0-py2-none-any.whl
| Download URL | djangorf_accounts-1.0-py2-none-any.whl |
|---|---|
| Size | 23.2 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
0ce6575bfebec4be7938abfdcd23a2d55bfecd6fdb4d5087895a028706e53f29
|
|
BLAKE2b-256 checksum How to use checksums |
3aa0b13a1e83a05bfbc2fdb4e0afde577e951623f1f3b950ff48d2833a2dc6bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |