2
votes

I am totally new to askbot-django-python. please help me.

I used a guide available at askbot.org to install askbot 0.10.0 in Ubuntu 15.10 server. During installation, after runserver command, when I try to access the site from remote computer, subject error message get displayed.I spent entire day to figure it out but unable to. please help me

details appended below:

Request Method: GET
Request URL: http://212.222.47.4:8000/questions/
Django Version: 1.7
Exception Type: TemplateSyntaxError
Exception Value: Invalid block tag: 'import'

Exception Location: /usr/local/lib/python2.7/dist-packages/django/template/base.py in invalid_block_tag, line 344
Python Executable: /usr/bin/python
Python Version: 2.7.10
Python Path: '/var/www/html/askbot/public_html',
'/usr/local/lib/python2.7/dist-packages/django_debug_toolbar-1.4-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/python_openid-2.2.5-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/django_filter-0.5.4-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/django_haystack-1.2.0-py2.7.egg',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/var/www/html/askbot',
'/usr/local/lib/python2.7/dist-packages/askbot/deps']

Server time: Sat, 2 Jan 2016 07:29:04 -0600

The traceback is appended below:


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
111. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/askbot/views/readers.py" in questions
287. return render(request, 'main_page.html', template_data)
File "/usr/local/lib/python2.7/dist-packages/django/shortcuts.py" in render
48. return HttpResponse(loader.render_to_string(*args, **kwargs),
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string
170. t = get_template(template_name, dirs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in get_template
144. template, origin = find_template(template_name, dirs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in find_template
132. source, display_name = loader(name, dirs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in call
44. return self.load_template(template_name, template_dirs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in load_template
50. template = get_template_from_string(source, origin, template_name)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in get_template_from_string
156. return Template(source, origin, name)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in init
132. self.nodelist = compile_string(template_string, origin)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in compile_string
162. return parser.parse() File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in parse
290. compiled_result = compile_func(self, token)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in do_extends
201. nodelist = parser.parse()
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in parse
288. self.invalid_block_tag(token, command, parse_until)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in invalid_block_tag
344. raise self.error(token, "Invalid block tag: '%s'" % command)


Exception Type: TemplateSyntaxError at /questions/
Exception Value: Invalid block tag: 'import'

2
Let's see the template file for /questions/ - onyeka
Seems like it's using the Jinja2 template engine, DTL doesn't have an {% import %} tag. - knbk
Onyeka - Thank you. are you referring to question.html located at /usr/local/lib/python2.7/dist-packages/askbot/templates/? - Babu ML
knbk - Thank you. but what should i do to resolve the issue? should i install Jinja2 template engine separately? I installed askbot, per guide available at install askbot in ubuntu - Babu ML

2 Answers

0
votes

Finally, into second day, upgraded django to 1.8. The issue got resolved, though not sure what was the root cause.

Per askbot documentation, 0.10.0 supports only django 1.7. However upgrading to 1.8, resolved the issue.

0
votes

This error happens when your TEMPLATES settings.py value is the default django-admin startproject value, askbot has a specific override that you can see if thier setup_templates

https://github.com/ASKBOT/askbot-devel/blob/master/askbot/setup_templates/settings.py#L76-L91