per page, with , order by , clip by
Results of 1 - 9 of about 9 for attachment (0.007 sec.)
PDFファイルを作成する 12007
PDFファイルを作成する このドキュメントでは、Django のビューを使用して PDF ファイルを動的に出力する方法を説明します。これは、優れたオープンソースの Python PDF ライブラリ ReportLab により可能になっています。 PDF ファイルを動的に生成する利点は ... ition header so that browsers # present the option to save the file. buffer . seek ( 0 ) return FileResponse ( buffer , as_attachment = True , filename = "hello.pdf" ) コードとコメントが自分自身の意味を説明しているはずですが、いくつかの点には言及しておくべ ... キュメントがHTMLファイルや一般的な application/octet-stream バイナリコンテンツではなく、PDFファイルであることを伝えます。 as_attachment=True が FileResponse に渡されると、適切な Content-Disposition ヘッダが設定され、ウェブブラウザはそのマシンでデフォルトが設 ... されていたとしても、そのドキュメントをどのように扱うかを確認するダイアログボックスをポップアップするようになります。もし as_attachment パラメータが省略された場合、ブラウザはPDFを扱うために設定されたプログラムやプラグインを使ってPDFを扱います。 任意の filena ...
https://man.mtool.work/django/6.1/howto/outputting-pdf.html
CSVを出力する 11162
CSVを出力する このドキュメントでは、Django のビューを使って動的に CSV (Comma Separated Values) を出力する方法を説明しています。そのためには、Python のCSV ライブラリか Django のテンプレートシステムを使います。 Python の CSV ライブラリを使う ... ith the appropriate CSV header. response = HttpResponse ( content_type = "text/csv" , headers = { "Content-Disposition" : 'attachment; filename="somefilename.csv"' }, ) writer = csv . writer ( response ) writer . writerow ([ "First row" , "Foo" , "Bar" , " ... ) return StreamingHttpResponse ( stream_batched_rows (), content_type = "text/csv" , headers = { "Content-Disposition" : 'attachment; filename="somefilename.csv"' }, ) テンプレートシステムを使う もしくは、 Django のテンプレートシステム を使って CSV を生成 ... ith the appropriate CSV header. response = HttpResponse ( content_type = "text/csv" , headers = { "Content-Disposition" : 'attachment; filename="somefilename.csv"' }, ) # The data is hardcoded here, but you could load it from a database or # some other sou ...
https://man.mtool.work/django/6.1/howto/outputting-csv.html
メールを送信する 11162
メールを送信する Django provides wrappers for Python's email and smtplib modules to simplify composing and sending email. Django's email framework also supports swapping in different delivery mechanisms: you can direct email to the console ... des functions for conveniently sending email, as well as classes for building and sending more complex email messages with attachments and multiple content types. 注釈 django.core.mail で送信されるメールの文字セットは、 DEFAULT_CHARSET 設定の値にセットされ ... rough the send_mail() and related wrapper functions. If you wish to use advanced features, such as BCC'ed recipients, file attachments, or multi-part email, you'll need to create EmailMessage instances directly. 注釈 This is a design feature. send_mail() a ... sending the email. reply_to : メールを送信するときに "Reply-To" ヘッダ内で使われる、受信者のアドレスのリストまたはタプル。 attachments : A list of attachments to put on the message. Each can be an instance of MIMEPart or EmailAttachment , or a tuple with a ...
https://man.mtool.work/django/6.1/topics/email.html
リクエストとレスポンスのオブジェクト 8628
リクエストとレスポンスのオブジェクト 簡単な概要 Django は、システムを通じてステータスを渡すために、リクエストとレスポンスのオブジェクトを使います。 あるページがリクエストされたとき、Django はリクエストに関するメタデータを含んだ HttpRequest ... ttpResponse ( ... my_data , ... headers = { ... "Content-Type" : "application/vnd.ms-excel" , ... "Content-Disposition" : 'attachment; filename="foo.xls"' , ... }, ... ) Content-Disposition ヘッダについては Django 固有のものはありませんが、その構文を忘れや ... 場合は、ビュー自体で 切断を処理する 必要があるかもしれません。 FileResponse オブジェクト class FileResponse ( open_file , as_attachment = False , filename = '' , ** kwargs ) [ソース] FileResponse はバイナリファイルに最適化された StreamingHttpResponse のサブク ... I サーバーが提供していれば wsgi.file_wrapper を使用し、そうでない場合はファイルを小さなチャンクでストリーミングします。 as_attachment=True だと、 Content-Disposition ヘッダーが attachment に設定され、ブラウザにファイルをダウンロードするように要求します。そ ...
https://man.mtool.work/django/6.1/ref/request-response.html
Django ユーティリティ (django.utils) 7783
Django ユーティリティ ( django.utils ) このドキュメントは、 django.utils のすべての安定したモジュールを対象としています。 django.utils 内のほとんどのモジュールは内部使用を目的としていることから、 内部リリース非推奨ポリシー に従い、以下に記載 ... ルトでは現在時刻になります。 次の形式で文字列を出力します: Wdy, DD Mon YYYY HH:MM:SS GMT 。 content_disposition_header ( as_attachment , filename ) [ソース] RFC 6266 に指定された filename から Content-Disposition HTTPヘッダー値を構築します。 as_attachment が ...
https://man.mtool.work/django/6.1/ref/utils.html
Django 2.1 リリースノート 7783
Django 2.1 リリースノート 2018年8月1日 Django 2.1 へようこそ! このリリースノートでは、 バージョン 2.1 の新機能 と、Django 2.0 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した機能を ... th_info() . Added the samesite argument to HttpResponse.set_cookie() to allow setting the SameSite cookie flag. The new as_attachment argument for FileResponse sets the Content-Disposition header to make the browser ask if the user wants to download the fi ...
https://man.mtool.work/django/6.1/releases/2.1.html
チケットをトリアージする 7513
チケットをトリアージする Django uses Trac for managing the work on the code base. Trac is a community-tended garden of the bugs people have found and the features Django has decided to add. As in any garden, sometimes there are weeds to be ... ad" commit where the test fails. Now, report your results on the Trac ticket, and please include the regression test as an attachment. When someone writes a fix for the bug, they'll already have your test as a starting point. Reviewing patches A great way ...
https://man.mtool.work/django/6.1/internals/contributing/triaging-tickets.html
テストツール 7513
テストツール Django は、テストを書くのに便利なツールをいくつか提供しています。 There are community-maintained solutions! Django has a vibrant ecosystem. There are testing and fixtures solutions highlighted on the Community Ecosystem page. T ... ァイルフィールド名を、値としてアップロードしたいファイルへのファイルハンドルを渡すだけで十分です。例えば、フォームに name と attachment のフィールドがあり、後者が FileField の場合: >>> c = Client () >>> with open ( "wishlist.doc" , "rb" ) as fp : ... c . pos ... t ( "/customers/wishes/" , { "name" : "fred" , "attachment" : fp }) ... また、ファイルのようなオブジェクト (例えば StringIO や BytesIO ) をファイルハンドルとして指定することもできま ...
https://man.mtool.work/django/6.1/topics/testing/tools.html
Django 1.11 リリースノート 7225
Django 1.11 リリースノート April 4, 2017 Django 1.11 へようこそ! このリリースノートでは、Django 1.10 および過去のバージョンからアップグレードする際に知っておくべきいくつかの 後方互換性のない変更 に加え、 新機能 を説明しています。 いくつかの ... ll back to MIME type application/octet-stream when binary content that can't be decoded as UTF-8 is specified for a text/* attachment. ファイルストレージ io.TextIOWrapper でラップできるように、 File に readable() 、 writable() 、 seekable() メソッドが追加さ ...
https://man.mtool.work/django/6.1/releases/1.11.html
PREV 1 NEXT