Skip to main content

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) 
})
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 1.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uzu-accounts-app 1.1.6
File Size Uploaded
uzu-accounts-app-1.1.6.tar.gz 8.6 kB Details

Release files / uzu-accounts-app-1.1.6.tar.gz

Download URL uzu-accounts-app-1.1.6.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
45381961c4586d80dec13fdef17f8f3e539857b032179ad8dd60d0bdbf8f3c37
BLAKE2b-256 checksum
How to use checksums
cb82fc03d589867cb9a5260687e29e84c96e11b3db064811544abaf5a2a65cbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.6.8

Release history Release notifications | RSS feed

2.1.1

1 release file

2.0.0

1 release file

1.1.9

1 release file

1.1.8

1 release file

This release

1.1.6 This release

1 release file

1.1.5

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1

1 release file

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page