Skip to content

Latest commit

 

History

History
68 lines (41 loc) · 1.81 KB

README.md

File metadata and controls

68 lines (41 loc) · 1.81 KB

Install Python

Check to see if you already have Python installed on your system by running:

On a Mac: python3 --version

On Windows: python --version

If you already have Python installed, check to be sure it’s Python 3.8 or up. (For example, 3.11 is great!) We suggest waiting on 3.12 to give any dependencies time to be updated.

If you are using a Windows machine, it is possible that you don’t have Python installed. You’ll need to pause here for a moment and proceed to install it. See this document for more information.

Setting up to run scripts to work with Python.

The script will be run in a virtual environment. Start by creating a virtual environment. Navigate to to the project folder in the command line and run:

On a Mac: python3 -m venv venv

On Windows: python -m venv venv


After creating the virtual environment, you need to activate it:

On a Mac: source venv/bin/activate

On Windows: source venv/Scripts/activate


Once the virtual environment is activated, the beginning of your terminal prompt should display (venv).
Install the modules by running (in both a Mac and Windows):

pip install flask

You'll see a venv folder has been added to the directory with all of the installed dependencies.


To run your code, in the command line run:

Without a debugger: flask run

With a debugger: flask run --debug


The app will run at: http://127.0.0.1:5000/


To stop the run, click control + C. Then hard refresh the page. When making changes to your Python, HTML, or JavaScript code (and not using debugger) you'll need to stop the run after each change.


When finished, quit the run by clicking control + C and close the virtual environment by running:

deactivate