Skip to content

Starter and solution code for the Skillcrush class Using Python to Build Web Apps

Notifications You must be signed in to change notification settings

skillcrush/using-python-to-build-web-apps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

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. If your project includes additional dependencies to be installed, you can add them after "flask", leaving a space between each dependency.


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.

When making changes to your Python, HTML, or JavaScript code (and not using debugger) you'll need to stop the run after each change. After starting the run again, hard refresh the page.


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

deactivate


About

Starter and solution code for the Skillcrush class Using Python to Build Web Apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages