An open API service indexing awesome lists of open source software.

https://github.com/sanjayengineer121/python-django-assignment


https://github.com/sanjayengineer121/python-django-assignment

Last synced: 7 months ago
JSON representation

Awesome Lists containing this project

README

          

# Python-Django-Assignment

# --------Login Page using djangi rest framewoork

# ------New User sign up authentication

# ------Logout after that only authentication (it is not a refresh token)

# ----------------------------------------------------------------------

# ---------------I have connected mangodb database -----------------

----- Frame work used

- Werkzeug==2.3.7
- django-auth-framework==2.0.7
- WTForms==3.0.1
- djongo==1.3.6
- pymongo==4.6.1
- Django==5.0
- djangorestframework


#-------------How to run

@ First run command

pip install -r requirements.txt

@ second open mongo db graphical application and start server-

- setp 1

- step 2
- after press on connect i can se it is connected

- step 3
- press on plus icon to create a database(schema)

- step 4
- after submitting database and collection name


- step 5
enter detail below and update in settings.py

- setp 6
after that
we have to migrate that changes
1. python manage.py migrate
2. python manage.py makemigrations

- step 7
check in mongo db

- step 8
run command to run django server

loginproject>python manage.py runserver

APIs
- Login API
-
1. #akes phone number and password
2. Create the user if it does not exist
3. Validate the credentials and generate the user auth token
4. Returns the response in the JSON format

# Profile API
-
Takes the user auth token as input in the headers
Returns the user profile information in JSON format

# Logout API
- Takes the user auth token as input in the headers
- Logs out and clears all the sessions and token information for that user
- Returns the response
- Post logout, if we try profile API, it should not work as the user is logged
out