move dj-base.html template logic into spire