Skip to content

Getting Started

onlinejudge95 edited this page Nov 22, 2019 · 2 revisions

Setup

On an uber level, you need to do the following steps to get the server up and running in the development environment

  • Clone the repo
    $ git clone https://github.com/onlinejudge95/Flask-REST-Server-Template.git
    
  • Update the .env file
    $ cp .env.example .env
    $ cat .env
    FLASK_ENV=development
    FLASK_DEBUG=True
    
  • Create a virtual environment, we are using pipenv to make sure of deterministic builds
    $ pipenv --python 3.7
    $ pipenv install --dev
    
    You can generate
    • a Pipfile.lock
      $ pipenv lock
      
    • a requirements.txt
      $ pipenv lock --requirements > requirements.txt
      
  • Start the server
    $ pipenv run python manage.py
    
  • To run tests
    $ pipenv run pytest --cov-config=.coveragerc --cov-report xml --cov app app/test
    
  • To run static analysis
    $ pipenv run pylint --rcfile .pylintrc manage.py app
    
Clone this wiki locally