Can I use ContextMixin with an APIView

13 views
Skip to first unread message

Leo Breebaart

unread,
Feb 16, 2015, 1:23:04 PM2/16/15
to django-res...@googlegroups.com
I have an APIView for which I would like to pass some extra information to my template in case of HTML rendering. 
It would appear that Django's ContextMixin, which allows me to override get_context_data() and which passes
a 'view' object automatically to my normal Django templates (e.g. TemplateView), is not used in the REST Framework's 
APIViews. My perhaps naive attempt to simply provide it as a superclass to my class-based view does not seem to have any effect either.

Is there a way to achieve what I want, or should I simply not want what I want?

Many thanks in advance for any help.

-- 
Leo Breebaart

Reply all
Reply to author
Forward
0 new messages