🌏 개발환경

[web app prototyping with GCP] 5. Setup frontend VM / backend VM

써니(>_<) 2022. 10. 20. 04:01
  1. Install the required packages for frontend:
pip install dash
pip install dash-renderer
pip install dash-html-components
pip install dash-core-components
pip install plotly
pip install requests

#create firewall exception for dash (Open the dash port to allow remote connections)
sudo gcloud compute firewall-rules create dash-conn --allow=tcp:8050

 

2. Install the required packagesfor backend 

#Check Python version
python --version

#Install library to create virtual environment
sudo apt install python-virtualenv

#Create the project folder in which storing your virtual environment
mkdir myback_end_project
cd myback_end_project
python3 -m venv myback_end

#Activate the virtual environment
. myback_end/bin/activate

#Install Flask in your virtual environment
pip install Flask

#Install packages dependencies
sudo apt install libpq-dev python3-dev
pip install psycopg2-binary
pip install SQLAlchemy

#Create a firewall exception for flask
sudo gcloud compute firewall-rules create flask-conn --allow=tcp:5000