Study project for Django REST API Framework
This Project is a Django REST API providing a per-project ticketing system. It can be accessed via requests.
The documentation is available at : https://documenter.getpostman.com/view/12451273/UVJeEG88
This program runs under python 3.9 in a virtual environment.
Thus, it is usable on Windows, Unix-based operating systems
insofar as the followings are installed:
- python 3.9 (including pip3)
- virtualenv
Linux
installation of python3.9:
$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt update
$ sudo apt install python3.9
installation of pip3:
$ wget https://bootstrap.pypa.io/get-pip.py
$ python3.9 get-pip.py
$ pip --version
Installation of virtualenv :
$ sudo apt install virtualenv
Mac
installation of python3.9 and pip3:
$ brew install python@3.9
(pip3 comes along with it)
if not, download and install the file get-pip.py from https://bootstrap.pypa.io/get-pip.py
$ py get-pip.py
Installation of virtualenv :
$ pip3 install virtualenv
Windows
installation of python3.9 and pip3:
Download and install python 3.9 for windows from python.org
(pip3 comes along with it)
if not, download and install the file get-pip.py from https://bootstrap.pypa.io/get-pip.py
$ py get-pip.py
Installation of virtualenv :
$ pip install virtualenv
Download the project:
Via Git
$ git clone https://github.com/AxAks/P10_SoftDest_DjangoREST.git
Via the Web
- Visit the page : https://github.com/AxAks/P10_SoftDest_DjangoREST.git
- Click on the button "Code"
- Download the project
Linux / Mac
in the project directory in a shell:
create the virtual environment
$ python3.9 -m virtualenv 'venv_name'
activate the environment:
$ source 'venv_name'/bin/activate
install project requirements:
$ pip install -r requirements.txt
Windows
in the project directory in a shell:
create the virtual environment
$ virtualenv 'venv_name'
activate the environment:
$ C:\Users'Username''venv_name'\Scripts\activate.bat
install project requirements:
$ pip install -r requirements.txt
Set the environment variables: create a file :"environment_variables.py" in the base directory "SoftdDesk" declare the following variables that will be used in "settings.py":
- SECRET_KEY = String: The Secret Key of the application
- db_filename = String: Name of the Database
- apps_logs_filename = String: Name of the Log File
## 4. Execution from the terminal, in the root directory of the project:
activate the environment:
$ source 'venv_name'/bin/activate
launch the Django server
$ python SoftDesk/manage.py runserver
-> The Server is ready
Definition of Endpoints:
Users:
- user registration (POST) URL -> /signup/
username : Username first_name: First Name last_name: Last Name email: Email Address password: Password password2: Password Confirmation
- login (POST) URL -> /login/
username: Usename password: Password
- token refresh (POST) URL -> /token_refresh/
token: current token
- Personal information (GET) URL -> /my_infos/
username: Usename password: Password
Projects:
- create project (POST) URL -> /projects/
title : Title description: Description type: Type (Back-End/Front-End/iOS/Android) Author: Automatically set to the current user time_created: Automatically set
-
list projects (GET) URL -> /projects/
-
find project (GET) URL -> /projects/{id_project}
-
edit project (PUT) URL -> /projects/{id_project} title : Title description: Description type: Type(Back-End/Front-End/iOS/Android)
-
delete project (DELETE) URL -> /projects/{id_project}
Contributors:
-
add contributor (POST) URL -> /projects/{id_project}/users/ user : User ID role: Role (Manager/Author)
-
list project contributors (GET) URL -> /projects/{id_project}/users/
-
find contributor (GET) URL -> /projects/{id_project}/users/{id_user}
-
edit contributor (PUT) URL -> /projects/{id_project}/users/{id_user} role: Role (Manager/Author)
-
remove contributor (DELETE) URL -> /projects/{id_project}/users/{id_user}
Issues:
-
create issue (POST) URL -> /projects/{id_project}/issues/ title: Title description: Description tag : Tag priority: Priority status: Status assignee: Assignee
-
list project issues (GET) URL -> /projects/{id_project}/issues/
-
find issue (GET) URL -> /projects/{id_project}/issues/{id_issue}
-
edit issue (PUT) URL -> /projects/{id_project}/issues/{id_issue} title: Title description: Description tag : Tag priority: Priority status: Status assignee: Assignee
-
delete issue (DELETE) URL -> /projects/{id_project}/issues/{id_issue}
Comments:
-
create comment (POST) URL -> /projects/{id_project}/issues/{id_issue}/comments/ description: Description
-
list issue comments (GET) URL -> /projects/{id_project}/issues/{id_issue}/comments/
-
find comment (GET) URL -> /projects/{id_project}/issues/{id_issue}/comments/{id_comment}
-
edit comment (PUT) URL -> /projects/{id_project}/issues/{id_issue}/comments/{id_comment} description: Description
-
delete comment (DELETE) URL -> /projects/{id_project}/issues/{id_issue}/comments/{id_comment}