Reworked static.py so that it generates pages from the database