diff --git a/plinth.py b/plinth.py index 2d10aa089..c453787e0 100755 --- a/plinth.py +++ b/plinth.py @@ -3,6 +3,7 @@ import os, stat, sys, argparse from gettext import gettext as _ import cfg +import django.conf if not os.path.join(cfg.file_root, "vendor") in sys.path: sys.path.append(os.path.join(cfg.file_root, "vendor")) @@ -178,13 +179,18 @@ def setup(): cherrypy.engine.signal_handler.subscribe() def main(): - # Initialize basic services - service.init() + # Initialize basic services + service.init() - setup() + setup() - cherrypy.engine.start() - cherrypy.engine.block() + # Configure Django + directory = os.path.dirname(os.path.abspath(__file__)) + templates_directory = os.path.join(directory, 'templates') + django.conf.settings.configure(TEMPLATE_DIRS=(templates_directory,)) + + cherrypy.engine.start() + cherrypy.engine.block() if __name__ == '__main__': main() diff --git a/templates/base.tmpl b/templates/base.html similarity index 56% rename from templates/base.tmpl rename to templates/base.html index ebfe48db6..182fe0f81 100644 --- a/templates/base.tmpl +++ b/templates/base.html @@ -1,10 +1,3 @@ -#def default($text, $default) -#if $text - $text -#else - $default -#end if -#end def @@ -31,22 +24,22 @@ - + -
FreedomBox Dashboard
- #block add_nav_and_login
- #end block add_nav_and_login
+
FreedomBox Dashboard
+ {% block add_nav_and_login %}
+ {% endblock %}
@@ -124,35 +117,35 @@