This project has been archived by its maintainers, and is no longer receiving any updates.
django-ai-kit-auth bundles everything authentication related and is meant to work seamlessly with the ai-kit-auth react component.
It provides routes for login, password validation, password reset, registration and account verification.
It includes a services to trigger the account validation and other functionality. It works with the standard django and with a custom user model as long as its provides an email address.
Standard Django sessions are used for authentification.
Quick Start
1.) Add ai-kit-auth to your INSTALLED_APPS like so:
INSTALLED_APPS = (
# ...
"rest_framework",
# ...
"ai-kit-auth",
# ...
"corsheaders",
)
rest_framework and corsheaders are dependencies and must be installed.
2.) Configuration is namespaced unter AI_KIT_AUTH like so:
AI_KIT_AUTH = {
"ACTIVATION_ROUTE": "activation",
"FRONTEND_URL": "example.com",
# ...
}
Note that FRONTEND_URL is a required configuration that does not have a default. Default configurations are:
AI_KIT_AUTH = {
"ACTIVATION_ROUTE": "activation",
"EMAIL_TEMPLATE_USER_CREATED_TITLE": "user_created_title.txt",
"EMAIL_TEMPLATE_USER_CREATED_BODY_PLAINTEXT": "user_created_body.txt",
"EMAIL_TEMPLATE_USER_CREATED_BODY_HTML": "user_created_body.html",
"USERNAME_REQUIRED": False,
"FRONTEND_URL": None,
}
In addition to that some general configuration is required:
CORS_ORIGIN_WHITELIST = [
"http://localhost:8000",
"http://localhost:3000",
# add other front-end backend urls
]
CORS_ALLOW_CREDENTIALS = True
# otherwise authentification to the django admin and the frontend can
# interfere with eath other
CSRF_USE_SESSIONS = True
CSRF_TRUSTED_ORIGINS = [
"http://localhost:8000",
"http://localhost:3000",
# add other front-end backend urls
]
See the django-cors-headers for details.
3.) Include the routes in your urls.py:
urlpatterns = [
# ...
re_path("^api/v1/", include("ai_kit.urls"))
# ...
]
4.) Run python manage.py migrate. Only required if you add the dependencies to your project since this package does not define models on its own.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-ai-kit-auth-0.1.5.tar.gz.
File metadata
- Download URL: django-ai-kit-auth-0.1.5.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3aabecc0455cfce619096a6631459771c77ba5fd8b3ea8adf03c2444a6d326f1
|
|
| MD5 |
2b4afd9830cc34cfc8c6445e24879eb6
|
|
| BLAKE2b-256 |
bea2261682403d43fc17c3c930aedfac4e72d20f66638a26184a072e306d3471
|
File details
Details for the file django_ai_kit_auth-0.1.5-py3-none-any.whl.
File metadata
- Download URL: django_ai_kit_auth-0.1.5-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb66bea44585823031cd0c71b16064cd9f445f4175af6923f85ca9b6c7a3c7bd
|
|
| MD5 |
292516a026907c1ee7ac5bc563647ebe
|
|
| BLAKE2b-256 |
6d44cb519624f2e981295bd644f4a671a7a1f68caa387d7bc34888cbeee03749
|