diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2019-10-25 08:11:11 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-10-25 08:12:15 +0200 |
| commit | 6df42e6187121e641ea7250855f63edfb2ec005d (patch) | |
| tree | 9e8c1fa75c5ef76ed0ca293ff10f1d7705025f4e /docs | |
| parent | 2c397f35eda92a5f68f76a9b4f66ce0f262d103f (diff) | |
[3.0.x] Fixed #30906 -- Fixed an example of using the template system to generate CSV.
Backport of 05c3ef26a203de1bc227e31b88999ff2e3b11abf from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/howto/outputting-csv.txt | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/docs/howto/outputting-csv.txt b/docs/howto/outputting-csv.txt index 7c3d1d0a8e..2886a1b294 100644 --- a/docs/howto/outputting-csv.txt +++ b/docs/howto/outputting-csv.txt @@ -104,7 +104,7 @@ template output the commas in a :ttag:`for` loop. Here's an example, which generates the same CSV file as above:: from django.http import HttpResponse - from django.template import Context, loader + from django.template import loader def some_view(request): # Create the HttpResponse object with the appropriate CSV header. @@ -119,9 +119,7 @@ Here's an example, which generates the same CSV file as above:: ) t = loader.get_template('my_template_name.txt') - c = Context({ - 'data': csv_data, - }) + c = {'data': csv_data} response.write(t.render(c)) return response |
