Opened 18 years ago
Closed 18 years ago
#6426 closed (fixed)
Documentation fault at #writing-custom-template-tags, load_template
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Keywords: | #writing-custom-template-tags, custom template tags, load_template | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Auto-escaping considerations >> New in Django development version states:
def render(self, context):
t = template.load_template('small_fragment.html')
return t.render(Context({'var': obj}, autoescape=context.autoescape))
This simply won't work because you're referring to django.template.load_template, which doesn't exist.
You probably mean django.template.loader.get_template(), or render_to_string().
Change History (2)
comment:1 by , 18 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(In [7130]) Fixed a few errors in the documentation. Thanks, Matthew Flanagan, panni@… and adamv.
Fixed #6411, #6426, #6524, #6555.