Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 1.72 KB

README.md

File metadata and controls

65 lines (45 loc) · 1.72 KB

api-workshop-starter-code

1. Pre-requisites

Ensure that you have Python installed. If you do not, see here to download it.

2. Project Setup

  1. Clone this repository

    Using HTTPS:

    git clone https://github.com/HackAtUCI/api-workshop-starter-code.git

    or SSH (you would need to set up an SSH key. See here for more information, otherwise use HTTPS):

    git clone [email protected]:HackAtUCI/api-workshop-starter-code.git
  2. Create a virtual environment

    This isolates the libraries you install in this environment from the libraries on your actual machine, preventing conflicts between libraries.

    python3 -m venv .venv
  3. Activate virtual environment

    VS Code may prompt to automatically select the newly created virtual environment. Otherwise, for Mac/Linux, run

    source .venv/bin/activate

    and for Windows, run

    .\.venv\scripts\activate
  4. Install dependencies

    pip install -r requirements.txt

    This will install all of the packages that you need for the python files to work.

3. Running the app

Run this command:

flask run

and a server will run at http://127.0.0.1:5000 (or http://localhost:5000).

Note: changing any Python code will not update the server that is running. You must stop the server and re-run flask run to see any changes.

However, if you run

flask run --debug

Flask will automatically reload itself if you change the Python code. This also enables an interactive debugger.