H4CK-3ND
An interactive back-end workshop created for SwampHacks 2019.
Google Slides Presentation: link
ABOUT
The purpose of this workshop is to help participants learn how to use Flask and Python in an interactive manner. Less slides, more code.
Since this is a back-end workshop, all front-end material (HTML, CSS) can be left untouched.
DO IT YOURSELF
- Make sure you have a working Python environment with
pipinstalled. - Download and unzip flask-workshop.zip.
cdinto theflask-workshopdirectory containinghack-end.py.pip install flaskandpip install pandas(in a virtualenv if you wish).- Set appropriate environment variables (
FLASK-APP=hack-end.py,FLASK_DEBUG=1) flask run(set the-pflag if the default port5000is already used).- Take a look at the running app on
localhost:in your browser. Make sure you see “Hello world!”. - Download 0-start.py and copy/replace the contents into
hack-end.py. - Take a look at the running app again. You’ll see some broken links. Fix them.
- Download the next file once you’ve completed each segment. Have fun!
SOLUTIONS/NEXT STEPS
I was hoping to do this in the style of a CTF. Then I realized it would be very difficult to serve the answer tokens individually since the participants have full access to the back-end files. I ended up giving these links out iteratively to the entire group.
ACKNOWLEDGEMENTS
- Data source: Kaggle: S&P 500 stock data
- Hack4Impact’s Flask Workshop: GitHub
- SwampHacks 2019 sponsors and organizers!