diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-01-31 13:39:29 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-01-31 13:54:40 +0100 |
| commit | 89cb771be7b53c40642872cdbedb15943bdf8e34 (patch) | |
| tree | 43b9e7addfe0d5f2ad99a569507f4c19562e4aef /docs/howto | |
| parent | b2039d39d537340c1617f23d68b3f40f070e01db (diff) | |
Fixed #19692 -- Completed deprecation of mimetype in favor of content_type.
Thanks Tim for the report and initial patch.
Diffstat (limited to 'docs/howto')
| -rw-r--r-- | docs/howto/outputting-csv.txt | 6 | ||||
| -rw-r--r-- | docs/howto/outputting-pdf.txt | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/docs/howto/outputting-csv.txt b/docs/howto/outputting-csv.txt index bcc6f3827b..1f9efb5a4b 100644 --- a/docs/howto/outputting-csv.txt +++ b/docs/howto/outputting-csv.txt @@ -20,7 +20,7 @@ Here's an example:: def some_view(request): # Create the HttpResponse object with the appropriate CSV header. - response = HttpResponse(mimetype='text/csv') + response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="somefilename.csv"' writer = csv.writer(response) @@ -92,7 +92,7 @@ Here's an example, which generates the same CSV file as above:: def some_view(request): # Create the HttpResponse object with the appropriate CSV header. - response = HttpResponse(mimetype='text/csv') + response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="somefilename.csv"' # The data is hard-coded here, but you could load it from a database or @@ -111,7 +111,7 @@ Here's an example, which generates the same CSV file as above:: The only difference between this example and the previous example is that this one uses template loading instead of the CSV module. The rest of the code -- -such as the ``mimetype='text/csv'`` -- is the same. +such as the ``content_type='text/csv'`` -- is the same. Then, create the template ``my_template_name.txt``, with this template code: diff --git a/docs/howto/outputting-pdf.txt b/docs/howto/outputting-pdf.txt index 9d87b97710..d15f94f7f4 100644 --- a/docs/howto/outputting-pdf.txt +++ b/docs/howto/outputting-pdf.txt @@ -51,7 +51,7 @@ Here's a "Hello World" example:: def some_view(request): # Create the HttpResponse object with the appropriate PDF headers. - response = HttpResponse(mimetype='application/pdf') + response = HttpResponse(content_type='application/pdf') response['Content-Disposition'] = 'attachment; filename="somefilename.pdf"' # Create the PDF object, using the response object as its "file." @@ -120,7 +120,7 @@ Here's the above "Hello World" example rewritten to use :mod:`io`:: def some_view(request): # Create the HttpResponse object with the appropriate PDF headers. - response = HttpResponse(mimetype='application/pdf') + response = HttpResponse(content_type='application/pdf') response['Content-Disposition'] = 'attachment; filename="somefilename.pdf"' buffer = BytesIO() |
