Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Latest commit

 

History

History
58 lines (41 loc) · 1.32 KB

README.md

File metadata and controls

58 lines (41 loc) · 1.32 KB

Dr-trottoir django backend

Info

The django backend works with these extra modules

  • django rest framework
    • Easily making REST API's
  • simpleJWT
    • simple json web tokens for the cookies and authentication

Setup

The first thing to do is to clone the repository:

$ git clone [email protected]:SELab-2/Dr-Trottoir-5.git
$ cd Dr-Trottoir-5
$ cd backend

Create a virtual environment to install dependencies in and activate it:

$ virtualenv2 --no-site-packages env
$ source env/bin/activate

Then install the dependencies:

(env)$ pip install -r requirements.txt

Note the (env) in front of the prompt. This indicates that this terminal session operates in a virtual environment set up by virtualenv2.

Once pip has finished downloading the dependencies:

Database setup

Download and install postgresql from here. Make an empty database and a user for this project.

In the backend directory. Copy the env file and fill in you own values. The location of .env should be in the same location of settings.py:

(env)$ cp .env.example .env

Run the backend

(env)$ python manage.py runserver

And navigate to http://127.0.0.1:8000.

Tests

Todo setup tests and testing environment