Tuesday, May 26, 2020

Re: How to retrieve the values from the context_process.py file to template?

On Tuesday, 26 May 2020 17:27:13 UTC+1, Aboyeji Solomon Adeleke wrote:
Yes, import the get_result from the context_process.py

This is entirely wrong. The point of a context processor is that it is automatically added to the template context. You shouldn't be importing it or calling it specifically in your view.

OP's original code should have worked (although there's a pointless reference to RequestContext that should be deleted).
--
DR.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a9d314d2-69a4-4b14-b4ed-3f132b28e482%40googlegroups.com.

No comments:

Post a Comment