Implements a Squad Maker web application using the python Flask framework and Bootstrap library. For a description of the challenge project and its requirements visit this link.
An instance of this application has been deployed to PythonAnywhere and is temporarily accessible at http://rhyanarthur.pythonanywhere.com
- The Players REST API will not require authentication.
- The application will not be expected to scale to a very large amount of players. It will be reasonable to display all players and/or squads on the same page without the need for pagination. This also implies an O(n^2) squad-making algorithm will be acceptable.
- The Bootstrap CDN and googleapis.com domain will be accessible from the client (I didn't download local copies of the hosted resources I'm using).
- Clone the squad-maker repository
git clone https://github.com/arthurcode/squad-maker.git
- Create a python 3.6 virtualenv
mkvirtualenv --python=/usr/bin/python3.6 my-virtualenv
- Install required python packages in the virtualenv
pip install -r /path/to/squad-maker/requirements.txt
- Set the FLASK_APP and FLASK_ENV environment variables
export FLASK_APP=squad_maker_app
export FLASK_ENV=development
- Run the development server (IP address and port will be printed to the screen)
cd /path/to/squad-maker
flask run
To modify the default application settings create a new configuration file .py file and set the SQUAD_MAKER_SETTINGS environment variable to point at the new file.
export SQUAD_MAKER_SETTINGS=/path/to/new/config.py
Then restart the development server.
- Make sure the squad-maker directory is on your PYTHONPATH
export PYTHONPATH=/path/to/squad-maker/
- Run the unit tests
cd /path/to/squad-maker/tests/unit
python -m unittest
- Run the benchmark.py integration test
cd /path/to/squad-maker/tests/integration
./benchmark.py