Skip to content

hazelduan/webapp

Repository files navigation

webapp Assignment 2 for 1779

THis is the instructions for assign2, including db config, and flask run.

Database config(now the database is in RDS so no need to rebuild the table everytime)

  1. Before all running commands, update database in if necessary. First, use
    flask shell

Attention : need to be in frontend or memcache folder for flask need to find an app to run this command.

  1. Rebuild table

    from app import db
    db.drop_all()
    db.create_all()
  2. Before connecting to database, add a password.py file in "/database" containing a variable password that is a string of your database password.

    password = "yourpassword"

Here replace "yourpassword" with your own password of MySQL.

Start flask instance.

  1. (Optional) Install virtual environment.

    python3 -m venv venv
  2. (Optional) Activate virtual environment.

    source venv/bin/activate

    if wanna quit, use deactivate

  3. Install dependencies.

    pip3 install -r requirements.txt
  4. Start Flask app. Now simply use one shell script.

    sh run.sh

    if system is Ubuntu, use

    ./run.sh

    *The other way is to run each flask instance separately.

    FLASK_APP=run.py
    DB_HOST=localhost:hostnumber flask --debug run --port <portnumber>

    Frontend port number is 5000, DB is 3306, autoscaler is 5020, memcache 5001-5008 and manager app is 8001.

About

group project

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors