This is a starter project for you to use to start your Flask web & database projects.
It contains quite a lot of example code. You can use this to see how the various parts of the project work, or you can delete it and start from scratch.
There are two videos to support:
# Clone the repository to your local machine
; git clone [email protected]:makersacademy/web-applications-in-python-project-starter-plain.git YOUR_PROJECT_NAME
# Or, if you don't have SSH keys set up
; git clone https://github.com/makersacademy/web-applications-in-python-project-starter-plain.git YOUR_PROJECT_NAME
# Enter the directory
; cd YOUR_PROJECT_NAME
# Set up the virtual environment
; python -m venv web-application-starter-venv
# Activate the virtual environment
; source web-application-starter-venv/bin/activate
# Install dependencies
(web-application-starter-venv); pip install -r requirements.txt
# Read below if you see an error with `python_full_version`
# Create a test and development database
(web-application-starter-venv); createdb YOUR_PROJECT_NAME
(web-application-starter-venv); createdb YOUR_PROJECT_NAME_test
# Open lib/database_connection.py and change the database name to YOUR_PROJECT_NAME
(web-application-starter-venv); open lib/database_connection.py
# Seed the development database
(web-application-starter-venv); python seed_dev_database.py
# Run the tests (with extra logging) - see below if you have any issues
(web-application-starter-venv); pytest -sv
# Run the web server
; python app.py
# Now visit http://localhost:5001/emoji in your browser
I get a ModuleNotFoundError: No module named 'psycopg'
If, after activating your
venv
and installing dependencies, you see this error when running pytest
, please deactivate and reactivate your venv
. This should solve the problem - if not, contact your coach.
If you would like to remove the example code:
; ./remove_example_code.sh