#30923: Out of date examples in docs that call render() with a Context instance
instead of regular dict
-------------------------------------+-------------------------------------
Reporter: Alasdair Nicol | Owner: (none)
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed
Keywords: Context render | Triage Stage: Accepted
template |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* status: new => closed
* resolution: => fixed
Old description:
> Following #30906, I found a couple more examples in the docs that are
> calling the template's render method with a Context instance when they
> should use a regular dict.
>
> * [https://docs.djangoproject.com/en/2.2/ref/contrib/sites/#getting-the-
> current-domain-for-display docs/ref/contrib/sites.txt ] - I will open a
> pull request for this
> * [https://docs.djangoproject.com/en/2.2/howto/custom-template-tags
> /#auto-escaping-considerations howto/custom-template-tags.txt] - I am not
> sure how to rewrite this example.
>
> I found these by searching with the following commands:
>
> {{{
> cd docs
> git grep 'render.*Context'
> git grep 'from django.*import.*Context'
> }}}
>
> Those grep commands also return results from `ref/templates/api.txt`, but
> they are ok because they use `t = Template()` instead of
> `loader.get_template()`.
New description:
Following #30906, I found a couple more examples in the docs that are
calling the template's render method with a Context instance when they
should use a regular dict.
* [https://docs.djangoproject.com/en/2.2/ref/contrib/sites/#getting-the-
current-domain-for-display docs/ref/contrib/sites.txt ] - I will open a
pull request for this
* ~~[https://docs.djangoproject.com/en/2.2/howto/custom-template-tags
/#auto-escaping-considerations howto/custom-template-tags.txt] - I am not
sure how to rewrite this example.~~
I found these by searching with the following commands:
{{{
cd docs
git grep 'render.*Context'
git grep 'from django.*import.*Context'
}}}
Those grep commands also return results from `ref/templates/api.txt`, but
they are ok because they use `t = Template()` instead of
`loader.get_template()`.
--
Comment:
Examples in `howto/custom-template-tags.txt` work with `Context()`.
Closing as fixed.
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:16>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107017f72658b6a-dcda8d3e-f860-4010-b0e0-72f1e26c894a-000000%40eu-central-1.amazonses.com.