Skip to content

Latest commit

 

History

History
63 lines (49 loc) · 2.68 KB

README.md

File metadata and controls

63 lines (49 loc) · 2.68 KB

Quiz-API

Django CI codecov Code style: black

Initial Setup

NOTE: If you found any issue while following any of the steps below, Please create a new issue to let me fix it.

Prerequisite:

Follow these steps to install the application in local environment:

  1. 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
  1. Install all the dependencies using Poetry and run setup.sh for some initial setup.
poetry install
sh ./setup.sh
  1. Run the test to make sure everything works well.
cd server
poetry run python manange.py test
  1. 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.


APIs

  • Got to redoc for getting all apis list and their detailed schema of body and response.
  • To test the api got to Swagger.

Some more Points:

  1. For authentication JWT token is used which can be get from login API.
  2. 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
  1. 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.
  2. To attempt the quiz auth token is must for identification.
    • Send token in header in formt Bearer {{your_access_token}} with key Authorization.
  3. 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.