fixed all internal urls to use url_for, support for mod_wsgi