#26410 closed Cleanup/optimization (fixed)
Add a docs example for loader.render_to_string()
Reported by: | Zach Borboa | Owned by: | Alberto Julio Leal Rivera |
---|---|---|---|
Component: | Documentation | Version: | 1.9 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
Hi. It appears the render_to_string shortcut example was removed. Can this example be added back to the docs? Thanks
Last seen in 1.7 docs
https://docs.djangoproject.com/en/1.7/ref/templates/api/#the-render-to-string-shortcut
Attachments (1)
Change History (10)
comment:1 by , 9 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 9 years ago
Hi Tim, I don't see the render_to_string
example on that page. Can this example be added back to the docs? Here's what was removed:
from django.template.loader import render_to_string rendered = render_to_string('my_template.html', {'foo': 'bar'})
comment:3 by , 9 years ago
Component: | Uncategorized → Documentation |
---|---|
Easy pickings: | set |
Summary: | Documentation for render_to_string removed → Add a docs example for loader.render_to_string() |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
Oh, I guess I don't see a good reason why it was removed other than it's a bit simple.
comment:4 by , 9 years ago
Resolution: | invalid |
---|---|
Status: | closed → new |
comment:5 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 9 years ago
Attachment: | 26410.diff added |
---|
comment:6 by , 9 years ago
HI.
I compared the file version at https://github.com/django/django/commit/ee8d5b91e94f6920f846512c978b703f62545ca8#diff-05455ade27e6c1bdf5c9a5140e5bcf96L930 with the current version and because the file have changed alot since the last time render_to_string was on the docs , I decided to put the same information that was removed at the end of the document.
Do you consider that the information should by updated or moved to another place inside api.txt?
Thanks.
comment:7 by , 9 years ago
That information is already present in doc in a slightly rephrased form. I'll make the fix since it's trivial.
It has moved here: https://docs.djangoproject.com/en/dev/topics/templates/#django.template.loader.render_to_string