tutorial for jinja2 integration issue?

I'd like to add few more pages(in django template) to askbot.
(extends two_column_body.html but use django template syntax)

Or someone might want to add askbot to his/her already operational site as an add-on.

I encountered jinja2 for the first time and I find it very hard to integrate jinja2 powered templates with other regular django-templates.

I've seen some homeworks..

http://stackoverflow.com/questions/15157997/django-app-not-running-after-installing-askbot/15160726#15160726

http://askbot.org/en/question/8105/why-does-askbot-use-jinja/

I wonder if you have a plan to make it easy to integrate askbot with other parts of a site.
by providing a tutorial or
by providing regular-django template for base.html or
by .. who knows what else..

Not allowing staticfiles to work with askbot makes it harder..

pcompassion's avatar
21
pcompassion
asked 2013-05-16 03:47:28 -0600, updated 2013-05-16 03:58:43 -0600
edit flag offensive 0 remove flag close merge delete

Comments

This solution is quite interesting http://concentricsky.com/blog/2013/jan/extending-jinja2-django-templates (linked from the same SO page) although I would just ditch the django templates because Jinja2 is significantly better. You are mentioning "not allowing staticfiles to work with askbot" - it seems to work for us - where do you see the issue.

Evgeny's avatar Evgeny (2013-05-16 04:16:17 -0600) edit

Ok, then suppose I have another app called MyApp.(to separate files from ones provided by askbot) I want to {% extend askbot_template.html %} from MyApp's templates. What's the required setup for this? 'Not allowing..' I don't know where I got that idea.. Probably, I saw an old askbot forum posting where it mentions staticfiles doesn't work. Maybe askbot didn't allow staticfiles and now it does?

pcompassion's avatar pcompassion (2013-05-16 04:31:07 -0600) edit

http://concentricsky.com/blog/2013/jan/extending-jinja2-django-templates I tried the solution and works fine. But it breaks when you have more than 1-depth extend. a.html extend my_common.html extend_jinja jinja_template.html nothing in a.html shows up.. :(

pcompassion's avatar pcompassion (2013-05-16 04:33:43 -0600) edit
add a comment see more comments