[Answered ]-Including self in the context

1👍

Is it advisable to include self in the context data that is being passed in the templates in django?

It is already included, as view. Indeed, you can for example use:

{{ view.request.GET.some_key }}

Does it have some security vulnerabilities or anything that may have a bad impact?

Templates are rendered at the server side, so as long as you don’t expose sensitive data when rendering the template, you’re fine. Of course if you pass more to the context, there is more "power" to expose sensitive data.

Leave a comment