Install Python 3.6: https://www.python.org
If you use Visual Studio Code, install the Python extension and add the following to your preferences:
"python.linting.pylintEnabled": false,
"python.formatting.provider": "black",
"[python]": {
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
This will ensure that your code is automatically fixed to conform to our coding style.
If you use another editor, follow their instructions to enable black and isort, and to enable fix-on-save.
Make sure python3-pip is installed
$ sudo pip3 install pipenv
# clone the repo
$ git clone https://github.com/cornytrace/SEP-Autumn-2018-Group2-Backend eit-dash-backend
# go into app's directory
$ cd eit-dash-backend
# install app's dependencies
$ pipenv sync --dev
# create database
$ pipenv run migrate
# create superuser
$ pipenv run python manage.py createsuperuser
# run the site with hot reload at localhost:8000
$ pipenv run server
# run linter
$ pipenv run black .
# run isort
$ pipenv run isort . -rc
# run unit tests with coverage
$ pipenv run pytest --cov
# generate full coverage report in htmlcov/
$ pipenv run coverage html