meeb / django-distill

Minimal configuration static site generator for Django
MIT License
441 stars 35 forks source link

support function based views with render shortcut. #1

Closed lexifdev closed 8 years ago

lexifdev commented 8 years ago

When try to use function based views with 'django.shortcuts.render' which is return 'django.http.HttpResponse' directly, django-distill's renderer is still try to call .render() method that not exists.

'django.template.TemplateResponse' has .render() but not in 'django.http.HttpResponse'.

So, I changed to call .render() only if type of response is 'django.template.TemplateResponse'.

meeb commented 8 years ago

Excellent thanks, well spotted. I didn't test with the shortcuts!