GithubHelp home page GithubHelp logo

cohort360-back-end's Introduction

Cohort360 Back-end

Installation

Customize settings.py

cp cohort_back/example.settings.py cohort_back/settings.py
"${EDITOR:-vi}" cohort_back/settings.py

Install requirements

pip install -r requirements.txt

Create database tables

python manage.py makemigrations cohort
python manage.py makemigrations explorations
python manage.py migrate

Load base data

python manage.py loaddata cohort/fixtures/data.json

Details & Development

Authentication

You can use two methods to authenticate users: simple or via LDAP (both need a user+password).

You will then be able to get a JSON Web Token (JWT) to further authenticate to other urls of this API.

  1. The first step is to create a user using a signup view and by specifying if it is via simple or LDAP auth.
  2. The user can now authenticate at /api/jwt/ by specifying a username and a password in the request data. This will return a JSON response containing an access and a refresh token.
  3. The user can now use its access token to browse other API urls by specifying it in the request authorization header ("Authorization: Bearer <the-access-token-here>").
  4. When the access token expires, use the /api/jwt/refresh url by specifying the refresh token in the request data. This will return a JSON response containing a new access token.

Development

The Swagger documentation is available at /docs/ when the server is running.

Medical data

Cohort back-end does not store any medical data. It only stores OMOP/FHIR ressources ids.

Modification d'un modèle

Il faut créer le fichier de migration associé avec la commande

python manage.py makemigrations <nom-du-module>

-> ça crée un fichier de migration dans /migrations

Puis

python manage.py migrate

pour l'appliquer en BDD.

First launch celery:

celery worker -B -A cohort_back --loglevel=info

Then launch the API:

python manage.py runserver

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.