Prerequisites : you need to have installed git, pipenv and postgresql on your machine (If you are on windows we suggest you run all these commands in WSL).
- Get your repo locally by running :
git clone https://github.com/Kariss83/vigilant-broccoli.git
. - Install all dependencies using pipenv (previously installed using pip) :
pipenv install
. - Create a postgresql DB named
purbeurredb2
on you computer. - Set up your environnement variables in a .env file at the root of your project.
- DB_USER='your_db_user'
- DB_PWD='users_db_pwd'
- DJANGO_KEY='your_secret_django_key'
- Set the virtual environment by running :
pipenv shell
- Start the server using
python manage.py runserver
oupython3 manage.py runserver
on Unix machines andpy manage.py runserver
on Windows machines.- (optionnal) If you try to launch the app for the first time you'll need to populate the DB by running
python manage.py populatedb
oupython3 manage.py populatedb
on Unix machines andpy manage.py populatedb
on Windows machines (this operation might take some time, please wait for the success message to pop).
- (optionnal) If you try to launch the app for the first time you'll need to populate the DB by running
- You can now go to the page http://127.0.0.1:8000 and have fun on your PurBeurre app.
- If you want to just run the tests after you've initiated your virtual environment, you can run :
python manage.py test
on Unix machines andpy manage.py test
on Windows machines. - If you want something with a bit more verbosity and to check coverage.
- you can create a file called 'coverage.sh' at the root of the project that contains the following:
#!/bin/sh set -e # Configure shell so that if one command fails, it exits coverage erase coverage run manage.py test --verbosity 2 coverage report
- make it executable using :
chmod +x coverage.sh
- run the command :
./coverage.sh
- If you want to check code linting on your project you can run
flake8
- (optionnal) You can set up flake8 by creating a setup.cfg file with the following content :
[flake8] exclude = accounts/migrations,home/migrations,products/migrations max-complexity = 10 max-line-length = 119
- For a nicer visual representation of that info you can run
flake8 --format=html --outputdir=flake-report
and open the html file that's in the flake-report directory.
- Python --> Django
- CSS --> Bootstrap
- JS
Romain VACHE
This project was built under the Creative Commons licence.