Skip to content
This repository has been archived by the owner on Mar 12, 2023. It is now read-only.

Latest commit

 

History

History

backend

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Flask Backend Deployment

THe backend uses Model to implement API, have a look at main.py

Run existing Backend Server

Setup Server

python3 -m venv python_modules          # create python environment
source ./python_modules/bin/activate    # activate python environment
python3 -m pip install -r package-lock.txt   # install python modules from package.txt
deactivate                              # deactivate python environment

Alternatively, you could use ppm (no available for Windows)

ppm install

Run Server

source ./python_modules/bin/activate    # activate python environment
python main.py                          # run back-end server
deactivate                              # deactivate python environment

Alternatively, you could use ppm (no available for Windows)

ppm start

Install new-package

source ./python_modules/bin/activate    # activate python environment
pip install new-package				# install new-package
python -m pip freeze > package-lock.txt		# save new-package to package.txt
deactivate                              # deactivate python environment

Alternatively, you could use ppm (no available for Windows)

ppm install new-package

Create Backend from scratch

Prerequisite

Create Flask App

mkdir backend
cd backend
python3 -m venv python_modules          # create python environment
source ./python_modules/bin/activate    # activate python environment
pip install flask flask-cors     		# install essitial modules
python -m pip freeze > package-lock.txt		# save dependencies to package.txt
deactivate                              # deactivate python environment

Alternatively, you could use ppm (no available for Windows)

mkdir backend
cd backend
ppm install
ppm install flask flask-cors           # install essitial modules

References