codes from michaelliao/awesome-python-webapp.