- Python 3.5 or above
- pip3
- Internet Connection
requirements.txt - This file conatins ALL the python dependencies needed to run the files presented in this repository
main.py - starting file ran by
app/database.py - defines functions related to our database. Also codes all the features for our website.
app/forms.py - defines all of our flask web forms
app/templates/ - this directory contains all the .html files that are used to frontend the pages on our website
First you must clone a copy of this repository in order to deploy our website
git clone https://github.com/akod0883/alma.git
cd alma/updatedDemoIt is advised that you create a python virtual environment and installing the packages in requirements.txt
To create a virutal evnironment using venv run the following command in the updatedDemo directory
python3 -m venv name_of_virtual_environmentTo activate the virtual enviornemnt
source name_of_virtual_environment/bin/activateIf this process is done correctly, there should be a (name_of_virtual_environment) next to your username is terminal
It should be noted that the database should be running on a mySQL server to observe and use all the features created in this repo. For the purposes of CS411 we used a mySQL server hosted on Google Cloud Platform (GCP). If this is something that you are interested in viewing, please contact any of the contributers to this repo, we would be delighted to spin up the server!
Create a app.yaml file in the updatedDemo with the following content:
touch app.yamlWithin app.yaml copy and paste the following information
runtime: python38 # or another supported version
instance_class: F1
env_variables:
MYSQL_USER: <user_name> # please put in your credentials
MYSQL_PASSWORD: <user_pw> # please put in your credentials
MYSQL_DB: <database_name> # please put in your credentials
MYSQL_HOST: <database_ip> # please put in your credentials
handlers:
# Matches requests to /images/... to files in static/images/...
- url: /img
static_dir: static/img
- url: /script
static_dir: static/script
- url: /styles
static_dir: static/stylesTo install all the dependencies for this proejct run the following command in the virtual evironement crated in the Setup step
python3 -m pip install -r requirements.txtTo deploy a development server of our website, run the following command in the updatedDemo directory
export FLASK_APP = app
flask runTo deploy our website hosted on GCP run the following commands in terminal Setting up the deployment
curl https://sdk.cloud.google.com | bash
gcloud components install app-engine-python
gcloud config set project cs411-sp21
gcloud auth login
gcloud app deploy