For this tect test for SkyBet I decided to try learn a new python framework to create a very light weight restful web app to control a form. I chose flask due to its very simple start up and useful libraries to create this. I also used the jquery.serialize-object library by macek https://github.com/macek/jquery-serialize-object to get the json in the correct object format as specified in the html template.
The plan is to:
- Create a local JSON file on disk, read from this file to populate a form with peoples first and second name. By using the root dirctory and GET request.
- Create a way to change this form and post it back to the server and save back to the file on disk. POST request send JSON from form.
- Add ID values to check boxes and send a DELETE request to the server to remove a particular form entry.
- A JQuery method to create a new item on the form so more users can be added.
- Add some form validation and a email field.
- Create some nice styles builing on a basic bootstrap theme.
Requirements:
Python 3.6
Install:
sudo pip install virtualenv \n
sudo pip install Flask
run:
. venv/bin/activate
export FLASK_APP=skyForm.py \n
flask run