Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
django-rest-registration
Advanced tools
User registration REST API, based on Django REST Framework.
Full documentation for the project is available at https://django-rest-registration.readthedocs.io/.
settings.AUTH_USER_MODEL
and also uses cryptographic signing instead of profile models)You can install Django REST Registration latest version via pip:
pip install django-rest-registration
Then, you should add it to the INSTALLED_APPS
so the app templates
for notification emails can be accessed:
INSTALLED_APPS=(
...
'rest_registration',
)
After that, you can use the urls in your urlconfig, for instance:
api_urlpatterns = [
...
path('accounts/', include('rest_registration.api.urls')),
]
urlpatterns = [
...
path('api/v1/', include(api_urlpatterns)),
]
You can configure Django REST Registration using the REST_REGISTRATION
setting in your Django settings (similarly to Django REST Framework).
Below is sample, minimal config you can provide in your django settings which will satisfy the system checks:
REST_REGISTRATION = {
'REGISTER_VERIFICATION_ENABLED': False,
'RESET_PASSWORD_VERIFICATION_ENABLED': False,
'REGISTER_EMAIL_VERIFICATION_ENABLED': False,
}
However, the preferred base configuration would be:
REST_REGISTRATION = {
'REGISTER_VERIFICATION_URL': 'https://frontend-host/verify-user/',
'RESET_PASSWORD_VERIFICATION_URL': 'https://frontend-host/reset-password/',
'REGISTER_EMAIL_VERIFICATION_URL': 'https://frontend-host/verify-email/',
'VERIFICATION_FROM_EMAIL': 'no-reply@example.com',
}
The frontend urls are not provided by the library but should be provided by the user of the library, because Django REST Registration is frontend-agnostic. The frontend urls will receive parameters as GET query and should pass them to corresponding REST API views via HTTP POST request.
In case when any verification is enabled (which is the default!), your Django application needs to be properly configured so it can send e-mails.
You can read more about basic configuration here.
You can read more about detailed configuration here.
You can find all REST_REGISTRATION
configuration options
here.
If you want to contribute, please refer to separate document CONTRIBUTING.md.
FAQs
User registration REST API, based on django-rest-framework
We found that django-rest-registration demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.