Giter VIP home page Giter VIP logo

hpquiz-rest-api's Introduction

Build Status

This repository contains the Django backend code for the yahpq.rocks website.

Versions

  1. Python- v3.7
  2. Django - v3.0.7
  3. Django REST Framework - v3.11.0

Creating a local setup

Initial setup

  1. Clone the repository using git clone https://github.com/AbhishekPednekar84/hpquiz-rest-api
  2. Create a virtual environment with python -m venv venv
  3. Activate the virtual environment with venv\Scripts\activate (Windows) or source venv/bin/activate (Linux / OsX)
  4. Install the project dependencies using the command pip install -r requirements.txt

Database setup

The project uses a PostgreSQL database with the connection string details stored in a .env file

  1. Create a .env file in the project root folder and add the SECRET_KEY and the database specific environment variables (please refer to the .env.example file). If using another database engine, modify the details accordingly.
  2. cd to the quiz_api_manager directory
  3. Create a migration using the command python manage.py makemigrations
  4. Run the migration with python manage.py migrate
  5. Create a superuser by running python manage.py createsuperuser
  6. Run the application using python manage.py runserver
  7. Assuming that the application is running on the default port 8000, the Swagger documentation should now be visible at http:\\localhost:8000

Other setup

The project uses the django-cors-headers library to talk to the Reactjs frontend.

  1. If the frontend is running on a port other than 3000, modify the CORS_ORIGIN_WHITELIST property in settings.py
  2. Add data using the django shell or via https:\localhost:8000\admin

Running tests

The project uses the pytest-django library to run test cases. To run a test, cd to the quiz_api_manager directory and run the pytest command

hpquiz-rest-api's People

Contributors

abhishekpednekar84 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.