NOTE: If you found any issue while following any of the steps below, Please create a new issue to let me fix it.
Prerequisite:
- Poetry
- Python ^3.7
- Recommended code editor VS Code
- Code formatting with Black
Follow these steps to install the application in local environment:
- Clone this repository and open the project in any code editor.
# cloning the repo
git clone https://github.com/namanwfhsolve/Quiz-API
# changing the dir to Quiz-API
cd Quiz-API
- Install all the dependencies using Poetry and run setup.sh for some initial setup.
poetry install
sh ./setup.sh
- Run the test to make sure everything works well.
cd server
poetry run python manange.py test
- Make migrations and Start the application at localhost.
poetry run python manage.py migrate
poetry run python manage.py runserver
Now visit http://localhost:8000/ping in the browser.
- Got to redoc for getting all apis list and their detailed schema of body and response.
- To test the api got to Swagger.
- For authentication JWT token is used which can be get from login API.
- For creating the Quiz one can use quiz_create_create or can create it from Django Admin also by going to Quiz tab.
- username:
admin
- password:
password
- To get the quiz list use the params
live_since__lte
(less than equal to) &available_till__gte
(greater than equal to) to get relevant reponse. - To attempt the quiz auth token is must for identification.
- Send token in header in formt
Bearer {{your_access_token}}
with keyAuthorization
.
- Send token in header in formt
- For image API execpt only valid url of images hosted on any storage. One can use https://github.com/namantam1/tempfiler to upload their images temporary.