DRF Registration
Simple user registration package based on Django Rest Framework. DRF Registration - The easy way to generate registration RESTful APIs.
Check the document at https://drf-registration.readthedocs.io/
Requirements
- Django (>=2.0)
- Django REST Framework (>=3.8.2)
- Python (>=3.6)
Features
- Register
- Verify/activate account by token sent to email
- Login use token
- Logout
- User profile
- Change password
- Reset password
- Login by socials (Facebook, Google)
- Set password when login by social
- Sync user account with socials
- HTML email configuration
- Test coverage (98%)
Installation & Configuration
Install by use pip:
pip install drf-registration
Add drf_registration in INSTALLED_APPS
INSTALLED_APPS = [
...
'rest_framework',
'rest_framework.authtoken',
'drf_registration',
...
]
Include urls of drf_registration in urls.py
urlpatterns = [
...
path('/api/accounts/', include('drf_registration.urls')),
...
]
Settings
Set AUTHENTICATION_BACKEND for support login by multiple custom fields and check inactivate user when login:
AUTHENTICATION_BACKENDS = [
'drf_registration.auth.MultiFieldsModelBackend',
]
You can update login username fields by change LOGIN_USERNAME_FIELDS in DRF_REGISTRATION object. Default to ['username', 'email',].
- Set
DEFAULT_AUTHENTICATION_CLASSESinREST_FRAMEWORKconfiguration
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.TokenAuthentication',
],
}
Design settings
DRF_REGISTRATION = {
}
Check default settings here.
Base APIs Design
Assuming that base resource is /api/v1/accounts/
POST: /register/: Register new userPOST: /verify/: Verify account by emailPOST: /login/: Login to the system use username/email and passwordPOST: /logout/: Logout of the systemGET: /profile/: Get user profilePUT: /profile/: Update user profilePUT: /change-password/: Change user passwordPUT: /set-password/: Set user password when login with social account
Check more APIs Design at here.
Command line
Unit Test
make test
You can add ARGS="specific_folder/" or ARGS="specific_file.py" to run specific test cases.
Run pylint
make pylint
Build & run docs local server
make docs
Access docs server at http://localhost:8080
Clean
make clean
Metadata
Release files for drf-registration 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| drf-registration-0.1.3.tar.gz | 16.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| drf_registration-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.7 kB
Release files / drf-registration-0.1.3.tar.gz
| Download URL | drf-registration-0.1.3.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7299032b2f7aeecd2c48642db6107ba1021ba8c0d3d1f33b9e35c632ccc9ac0f
|
|
BLAKE2b-256 checksum How to use checksums |
1868af06e9553e6b59f11a7601aca563e0db4338dd1ab6d1769943506e6b70e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / drf_registration-0.1.3-py3-none-any.whl
| Download URL | drf_registration-0.1.3-py3-none-any.whl |
|---|---|
| Size | 21.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf7b7e39733880700f5d8eb3db7404eb6aabe3cb94b700ddd4e61ef168bfcfe4
|
|
BLAKE2b-256 checksum How to use checksums |
3d3578c0469dee99cf5f9c399ca08adbe4cb0f7b3a214d1f7329d7445f6f5581
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Security for drf-registration 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.