Skip to content

Jliezed/oc_project_10_softdesk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oc rest-api django-rest-framework endpoints permissions postman swagger json-web-token cors owasp


OC - PROJECT N°10 - RESTful API Using Django Rest Framework

SoftDesk is an API for reporting and tracking technical issues.

By Douglas Lopes

Project Overview

Overview

Endpoints Summary

Authentication

Access Specification

Access

Example

PUT : /projects/1/

  • Author of the project 1 can update it
  • Contributor of the project 1 can read only detail
  • Other user of the API (not author or contributor) of project 1 can't access detail information of project 1

(back to top)

Built With

  • Python
  • Django Rest Framework
  • JSON Web Token

(back to top)

Getting Started

Installation & Running the script

  1. Clone the repo
    git clone https://github.com/Jliezed/oc_project_10_softdesk.git

Create and activate a virtual environment

  1. Go to your project directory
    cd oc_project_10_litreview
  2. Install venv library (if not yet in your computer)
    pip install venv
  3. Create a virtual environment
    python -m venv env
  4. Activate the virtual environment
    source env/bin/activate

Install packages

  1. Install the packages using requirements.txt
    pip install -r requirements.txt

Set environment variables

  1. Create a copy of the file ".env.default" and rename it ".env"
  2. Set value to the .env file:
    1. Define a secret key

    2. Debug to True for local development or False for production

    3. Allowed host equal to 127.0.0.1 for local environment

      SECRET_KEY='YOUR SECRET KEY'
      DEBUG=True
      ALLOWED_HOSTS=['127.0.0.1']

Run the server

python manage.py runserver
  1. Log to the API: http://127.0.0.1:8000/api/auth/login/
    User: toto
    Password: secret
  2. Or create a superuser
python manage.py createsuperuser

Access the different endpoints


(back to top)

API Documentation

(back to top)