Permalink
Browse files

replaced Django templating with Jinja2

  • Loading branch information...
1 parent 775b1f3 commit 43f5340728e85fbe082d13587c401b8a81d0da4c @dnet committed Sep 14, 2012
Showing with 6 additions and 8 deletions.
  1. +1 −1 README.md
  2. +4 −6 dashboard.py
  3. +1 −1 dashboard.sample.conf
View
@@ -33,6 +33,6 @@ Dependencies
- Python 2.x (tested on 2.5)
- PyQt4 (Debian/Ubuntu package: `python-qt4`)
- - Django (Debian/Ubuntu package: `python-django`)
+ - Jinja2 (Debian/Ubuntu package: `python-jinja2`)
- requests (http://docs.python-requests.org/)
- aleph-python-api (for `aleph_loaned` module only, https://github.com/dnet/aleph-python-api)
View
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
-# dashboard.py - generates an HTML file from modules using django
+# dashboard.py - generates an HTML file from modules using jinja2
#
# Copyright (c) 2011 András Veres-Szentkirályi
#
@@ -78,14 +78,12 @@ def serializeTodo(todo):
thash = sha1(tstr.encode('utf-8')).hexdigest()
if cvals['thash'] != thash or not os.path.exists(cvals['output']):
- from django.template import Template, Context
- from django.conf import settings
+ from jinja2 import Template
- settings.configure()
with open(cvals['template'], 'r') as f:
- tpl = Template(f.read())
+ tpl = Template(f.read().decode('utf-8'))
- html = tpl.render(Context({'todos': todos}))
+ html = tpl.render(todos=todos)
with open(cvals['output'], 'w') as f:
f.write(html.encode('utf-8'))
Config().setValue('core/thash', thash)
View
@@ -40,4 +40,4 @@ modules="redmine,orgmode,imapflag,github_issues"
output=/path/to/output.html
; file name to write output to
template=/path/to/template
-; django template to use
+; jinja2 template to use

0 comments on commit 43f5340

Please sign in to comment.