* [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()`.
--
Ticket URL: <https://code.djangoproject.com/ticket/30923>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Alasdair Nicol):
Pull request for sites docs: https://github.com/django/django/pull/11984
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:1>
* keywords: => Context render template
* version: 2.2 => master
* component: Uncategorized => Documentation
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:2>
* stage: Unreviewed => Accepted
Comment:
For the auto-escaping case, the solution I'm using is to define a custom
template engine with `OPTIONS` containing `'autoescape': False,`. I don't
know if this is the recommended new way of doing what the current example
does.
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:3>
* type: Uncategorized => Cleanup/optimization
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:4>
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
Comment:
The PR does not pass the checks, please update the PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:5>
* needs_better_patch: 1 => 0
Comment:
Tests failures are not related.
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:6>
* has_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:7>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"b991eefd3a9fa4da4eb46fddcb36cf1e8b5862e9" b991eefd]:
{{{
#!CommitTicketReference repository=""
revision="b991eefd3a9fa4da4eb46fddcb36cf1e8b5862e9"
Refs #30923 -- Fixed an example of rendering templates in contrib.sites
docs.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:8>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"78fc05303af90b8a693cb2868ced3b2c9daa176c" 78fc0530]:
{{{
#!CommitTicketReference repository=""
revision="78fc05303af90b8a693cb2868ced3b2c9daa176c"
[3.0.x] Refs #30923 -- Fixed an example of rendering templates in
contrib.sites docs.
Backport of b991eefd3a9fa4da4eb46fddcb36cf1e8b5862e9 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:9>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"406fb336b75663a0131251f9414d8cf5cc43e09b" 406fb336]:
{{{
#!CommitTicketReference repository=""
revision="406fb336b75663a0131251f9414d8cf5cc43e09b"
[2.2.x] Refs #30923 -- Fixed an example of rendering templates in
contrib.sites docs.
Backport of b991eefd3a9fa4da4eb46fddcb36cf1e8b5862e9 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:10>
* status: new => closed
* has_patch: 0 => 1
* resolution: => fixed
* stage: Accepted => Ready for checkin
Comment:
The patch was applied to master, im closing the ticket.
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:11>
* status: closed => new
* has_patch: 1 => 0
* resolution: fixed =>
* stage: Ready for checkin => Accepted
Comment:
Please don't close tickets that are not fixed. `howto/custom-template-
tags.txt` is waiting for a fix.
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:12>
* owner: nobody => Daniel Rios
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:13>
* owner: Daniel Rios => (none)
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:14>
* has_patch: 0 => 1
Comment:
I created a PR for the custom template tags docs:
https://github.com/django/django/pull/15495
--
Ticket URL: <https://code.djangoproject.com/ticket/30923#comment:15>
* 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>