data.py being run as a standalone script now works with postgresql