Skip to content

edd34/IRM-app

Repository files navigation

IRM-app

Il s'agit du backend d'une application d'info traffic pour le territoire de Mayotte. Il sera possible de géolocaliser un danger sur la route : caillassage, tronc d'arbre, nid de poule, dos d'âne etc... et de partager cette information à tous les usager de la route.

Configure the virtual environment

Create a new environment virtualenv

Create a virutal environment using virtualenv.

python3 -m venv venv

Entering the environment

source venv/bin/activate

Installation of package listed in requirement.txt

Use the package manager pip to install the dependencies.

pip3 install -r requirements.txt

Configure environment variables

  1. Rename the file .env-example to .env
  2. Fill the variable in .env file
POSTGRES_DB=(database name)
POSTGRES_USER=(database username)
POSTGRES_PASSWORD=(database password)
SECRET=(secret key for django operation)
CORS_WHITELIST_DOMAIN=(is the host name of the frontend app)
DJANGO_ENV= (can be dev or prod)

Steps when running the program for the first time.

In order to run the backend program, you should follow the steps described below. All commands are run from the root folder.

Refreshing migrations

python manage.py makemigrations

Applying migrations

python manage.py migrate

Import a sample database from CSV (TODO)

python manage.py importdb

Run the program

After the database is populated and correctly setup, you can run the backend server by executing the following command :

python manage.py runserver

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

API doc

The documentation of the public API is available under doc folder : API.md

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published