My rewrite of the BCA web framework in Python Flask
*Please use a Python 3.x virtual environment to avoid version issues
- Install a recent Python 3.x version.
- Clone the project from GitHub
- Create a Python 3.x virtual environment (do not add to Git!)
- From the terminal inside PyCharm run "pip install requirements.txt". Alternatively, open requirements.txt and PyCharm will likely prompt you to install the requirements.
- Copy config.py to bca_web direectory but do not add to GitHub. (Ideally we will move this file up a directory soon.)
set FLASK_APP=bca_web.py set FLASK_DEBUG=True flask run
export FLASK_APP=bca_web.py export FLASK_DEBUG=True flask run
cd bca_web
- Navigate to the folder- MAC OSX -
brew install mysql
Windows -https://dev.mysql.com/downloads/windows/installer/8.0.html
https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
python setup.py install
ORpip install requirements.txt
ORCLICK install dependencies if using PyCharm
- MAC OSX -
export FLASK_APP=bca_web.py
Windows -set FLASK_APP=bca_web.py
flask run
Debug mode makes testing a lot easier and displays errors.
Always make sure to keep debug mode ON during Development and OFF during Production
export FLASK_DEBUG=True
-
After successful email/password verification a JWT token is created for the current user and saved under the "bca_token" cookie.
-
The token has the following payload:
bca_token: { usr_id: Int, ip_address: Str, last_used: Int (Seconds), timeout_duration: Int (Seconds)}
-
Upon every request, the cookie is verified, checked for timeout, and updated.
-
The current user and their corresponding JWT token can always be accessed with the request context variable, g, under the attributes user and token respectively.
- Kate Kim
- Eleana Pardo
- Tara Yu
- Daun Lee
- Daniella Calle
- Anthony Lekan
- Aidan Glickman