add gitignore file for pyc, hook up db, improve functions in app.py