More refactoring of db.py
Merge branch 'website' of https://github.com/syncloud/redirect into website

Conflicts:
	redirect/db.py