adding security, settings, views

My primary changes:
1. security via whitelisting input fields and input file size
2. settings file usage for DB connection
3. usage of views instead of having queries in the python