Giter Site home page Giter Site logo

vigilant-broccoli's Introduction

forthebadge forthebadge forthebadge forthebadge

vigilant-broccoli

How to install locally your project

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).

  1. Get your repo locally by running : git clone https://github.com/Kariss83/vigilant-broccoli.git.
  2. Install all dependencies using pipenv (previously installed using pip) : pipenv install.
  3. Create a postgresql DB named purbeurredb2 on you computer.
  4. 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'
  5. Set the virtual environment by running : pipenv shell
  6. Start the server using python manage.py runserver ou python3 manage.py runserver on Unix machines and py 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 ou python3 manage.py populatedb on Unix machines and py manage.py populatedb on Windows machines (this operation might take some time, please wait for the success message to pop).
  7. You can now go to the page http://127.0.0.1:8000 and have fun on your PurBeurre app.

How to launch tests

  1. 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 and py manage.py test on Windows machines.
  2. 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

Linting with flake8

  1. 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
    
  2. 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.

Technologies

  • Python --> Django
  • CSS --> Bootstrap
  • JS

Authors

Romain VACHE

Licensing

This project was built under the Creative Commons licence.

vigilant-broccoli's People

Contributors

kariss83 avatar dependabot[bot] avatar

Watchers

Thierry Chappuis avatar  avatar

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.