A Django app to conduct web-based user authentication.
Project description
User Auth is a Django app to conduct web-based User Auth. For each question, visitors can choose between a fixed number of answers.
Detailed documentation is in the “docs” directory.
Quick start
- Dependency you have to install: pip install django-phonenumber-field djangorestframework djangorestframework-simplejwt phonenumbers django-rest-passwordreset Pillow
Add “User Auth” to your INSTALLED_APPS setting like this:
- INSTALLED_APPS = [
… ‘django_rest_passwordreset’, ‘phonenumber_field’, ‘user’,
]
- Include the User Auth URLconf in your project urls.py like this::
from django.urls import include path(‘api/user/’, include(‘user.urls’)),
Include the following line in your project settings.py like this:
AUTH_USER_MODEL = 'user.User'
Run python manage.py makemigrations and python manage.py migrate to create the User Auth models.
Start the development server and visit http://127.0.0.1:8000/admin/ to create a user (you’ll need the Admin app enabled).
Visit http://127.0.0.1:8000/api/ to participate in the user auth.
- all the url for particular action is given below,
user registration, url: http://127.0.0.1:8000/api/users/, method: post, body: login, url: http://127.0.0.1:8000/api/auth/, method: post, body: username, password
all user, url: http://127.0.0.1:8000/api/users/?limit=<any number. ex: 10>, method: get, body: retrieve single user, url: http://127.0.0.1:8000/api/users/<id>/, method: get, body: partial update user, url: http://127.0.0.1:8000/api/users/<id>/, method: patch, body: delete user, url: http://127.0.0.1:8000/api/users/<id>/, method: delete, body: update profile , http://127.0.0.1:8000/api/update_profile/, method: post change password, url: http://127.0.0.1:8000/api/change_password/, method: patch, body:{“old_password”:””, “new_password”:””} get refresh token, url: http://127.0.0.1:8000/api/token/refresh/, method: get, body: reset password , http://127.0.0.1:8000/api/password_reset/, method: post, body: {“email”:”youremail@gmail.com”}
We have used jwt authentication in this package So you need to add these following lines in your project settings.py file.
REST_FRAMEWORK = {“DEFAULT_AUTHENTICATION_CLASSES”: [“rest_framework_simplejwt.authentication.JWTAuthentication”]}
If you want only authenticated permission for your api’s then add the following lines REST_FRAMEWORK = {‘DEFAULT_PERMISSION_CLASSES’: [‘rest_framework.permissions.IsAuthenticated’,]}
If you want django model permission for your api’s then add the following lines REST_FRAMEWORK = {‘DEFAULT_PERMISSION_CLASSES’: [‘rest_framework.permissions.DjangoModelPermissions’]}
create group, url: http://127.0.0.1:8000/api/groups/, method: post, body: all group, url: http://127.0.0.1:8000/api/groups/?limit=<any number. ex: 10>, method: get, body: retrieve single group, url: http://127.0.0.1:8000/api/groups/<id>/, method: get, body: partial update group, url: http://127.0.0.1:8000/api/groups/<id>/, method: patch, body: delete group, url: http://127.0.0.1:8000/api/groups/<id>/, method: delete, body: get user role, http://127.0.0.1:8000/api/user_role/ , method: get
Project details
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
Hashes for django-user-auth-asl2-0.1.4.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d711ed8238d1f99aaf0e90d596c40428cdafee37e1fb0f0abe2c1af42dfbaf61 |
|
MD5 | 5690b0b30a38d977dca0fdb8f39d97fc |
|
BLAKE2b-256 | 95f0e0d07ccf8f2ee51ecb0ac2c031a6f8c47d9eb629e17a05a6a1bcb203e159 |
Hashes for django_user_auth_asl2-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a1dbe5c3c418b0f22a928b4b160a32fda447e26565217c3c52b54bd716bdaf0 |
|
MD5 | 1c234027009e12029d15b8c2ba7badaf |
|
BLAKE2b-256 | fb49a6e0a64f016e1c76ec88c82299832c9cbb8c06825ff66a05b6d8ce6f7fdb |