uzu-account-app
This is the official API documentation for the uzu-accounts-app Django Application.
uzu-accounts-app is a generic django application tailored to Single Page Applications that abstracts user authentication and verification from the rest of your project.
uzu-accounts-app will use the model set with AUTH_USER_MODEL in settings.py of your django project or the default user model of django.contrib.auth
Installation
Download and install the package from PyPi:
pip install uzu-accounts-app
Add AccountsApp.urls to your project's URLConf
urlpatterns = [
...
path("accounts/", include("AccountsApp.urls"))
]
Add the AccountsApp to your INSTALLED_APPS:
INSTALLED_APPS = [
...
"AccountsApp.apps.AccountsappConfig"
]
Setup the ACCOUNTS_APP settings variable in settings.py
ACCOUNTS_APP = {
"base_url": "", # Base url pattern for the AccountsApp urls
"redirect_link": "", # Link redirected to after link verification
"code_length": 3, # specifies the length of the verification code
"sign_in_after_verification": False # Specify if to sign in after verification is successful
}
Then apply migrations
python manage.py migrate
API
The app communicates with the client-side using basic api calls.
API responses have the following basic format:
{
status: Boolean, // status of the API call
data: Object, // payload
error: String // error string in case an error occurs (status == False)
}
API List
NB: The illustrations below assume that the app's urls were mapped to the accounts/ path.
1. sign-in
axios.post("/accounts/sign-in/", {
...accountFields,
keep_signed_in: true // keeps the user signed in (optional)
})
2. sign-up
axios.post("/accounts/sign-up/", {
...accountFields,
keep_signed_in: true // keeps the user signed in (optional)
})
3. sign-out
axios.get("/accounts/sign-out/")
4. authenticate
axios.post("/accounts/authenticate/", {
password: ""
})
5. reset-password
axios.post("/accounts/reset-password/", {
username: "", // field value used for authentication as set by user_model.USERNAME_FIELD
code: "", // verification code. This comes from send-verification-code
new_password: "",
})
6. change-password
axios.post("/accounts/change-password/", {
new_password: "",
old_password: ""
})
7. send-verification-code
axios.post("/accounts/send-verification-code/", {
username: "", // optional username (will use request.user.username if a user is signed in when this field is not specified. Fails otherwise)
mode: "", // (send || resend) optional mode (will use 'resend' by default, if set to 'send', the verification code is updated before sending)
})
8. send-verification-link
axios.post("/accounts/send-verification-link/", {
username: "", // optional username (will use request.user.username if a user is signed in when this field is not specified. Fails otherwise)
mode: "", // (send || resend) optional mode (will use 'resend' by default, if set to 'send', the verification code is updated before sending)
})
9. verify-code
axios.post("/accounts/verify-code/", {
username: "",
code: "",
})
Metadata
Release files for uzu-accounts-app 2.1.1
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 | Actions |
|---|---|---|---|---|
| uzu-accounts-app-2.1.1.tar.gz | 11.3 kB | Without provenance | Details for uzu-accounts-app-2.1.1.tar.gz |
Release files / uzu-accounts-app-2.1.1.tar.gz
| Download URL | uzu-accounts-app-2.1.1.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
929d15755e7dbe0c8e9f87b946947614d43eff4b3b1f0f8d8deb5253292524e0
|
|
BLAKE2b-256 checksum How to use checksums |
595f960a6a55727c28b58a16b6718f38be4535fda9ca8a92c843e0293c5c19d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.6.9
|
Security for uzu-accounts-app 2.1.1
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.