CITS3403 Project: Social Choice
The purpose of the application is to find the best recipe from a selection curated by administrators. The social choice mechanism to identify the best recipe is a first past the post polling system. Each unique user gets one unique vote per poll for their first preference and the winning recipe is the one with the highest votes.
HTML5, CSS, Javascript/JQuery, Bootstrap 4
Flask - micro web framework for routing WTForms - form input handling and validation Flask-Login - user session management
SQLAlchemy - database engine
- install python version 3
- install pip for python
pip install virtualenv
to install virtualenv
virtualenv --python=/usr/bin/python3.7 venv
orvirtualenv venv
to create virtual environment (we are using version 3.7)source venv/bin/activate
to activate,venv\Scripts\activate
to activate in MS Windowsdeactivate
to deactivate or go back to main python environment
pip install -r requirements.txt
to install flask, jinja2, etc
- make sure working directory is at the root of the project folder
export FLASK_APP=main.py
assigns the system environment variables (not necessary if python-dotenv is in requirements.txt)flask run
starts the server for the app- http://127.0.0.1:5000/ is the output page
makes system environment variables automatically loaded from a file
- flask uses the file .flaskenv
- no need to
export FLASK_APP=main.py
manually, but it is in the file .flaskenv
python unittest test_unittests.py
- Runs all the unit tests and outputs results
open the /selenium-tests/Cits3403 A Social Choice.side
project file in the selenium browser extension and run all tests
user: admin pass: test
user: test pass: test
log.txt