per page, with , order by , clip by
Results of 1 - 10 of about 29 for Hello (0.005 sec.)
暗号署名 14211
暗号署名 ウェブアプリケーションのセキュリティの黄金律は、信頼できない情報源からのデータを決して信頼しないことです。時には、信頼されていない媒体を通してデータを渡すことが有用な場合もあります。暗号的に署名された値は、改ざんが検知されることを前 ... したい場合は 、 sign_object() と unsign_object() メソッドを使います。 >>> signed_obj = signer . sign_object ({ "message" : "Hello!" }) >>> signed_obj 'eyJtZXNzYWdlIjoiSGVsbG8hIn0:bzb48DBkB-bwLaCnUVB75r5VAPUEpzWJPrTb80JMIXM' >>> obj = signer . unsign_ob ... ject ( signed_obj ) >>> obj {'message': 'Hello!'} 詳細は 複雑なデータ構造の保護 を参照してください。 何らかの理由により署名の値が書き換わってしまった場合、 django.core.s ... er . sign ( "My string" ) 'My string:v9G-nxfz3iQGTXrePqYPlGvH79WTcIgj1QIQSUODTW0' >>> signer . sign_object ({ "message" : "Hello!" }) 'eyJtZXNzYWdlIjoiSGVsbG8hIn0:bzb48DBkB-bwLaCnUVB75r5VAPUEpzWJPrTb80JMIXM' >>> signer = Signer ( salt = "extra" ) >>> ...
https://man.mtool.work/django/6.1/topics/signing.html
Django テンプレート言語 11159
Django テンプレート言語 このドキュメントはDjangoテンプレートシステムの文法を説明しています。もしあなたがもっと技術者的な観点でどう動かすかやどう拡張するかを知りたい場合は、 Python プログラマーのための Django テンプレート言語 を参照してくださ ... い。 コメント テンプレートの行の一部をコメントアウトするには、コメント構文 {# #} を使います。 たとえば、このテンプレートは 'hello' としてレンダリングされます: {# greeting #} hello コメントには、たとえ無効でも、どんなテンプレート・コードも含めることがで ... 上書きされます。たとえば、このテンプレートは title ブロックの内容を常に上書きします: {% if change_title %} {% block title %} Hello! {% endblock title %} {% endif %} 最後に、同じテンプレート内で同じ名前の block タグを複数定義することはできないことに留意し ... 結果に悪影響を与えるというリスクが常に付きまといます。たとえば、テンプレートに以下のような部分がある場合を考えてみましょう: Hello, {{ name }} 一見、このコードはユーザの名前を表示するだけの無害なものに見えます。しかし次のような値が名前として入力されてい ...
https://man.mtool.work/django/6.1/ref/templates/language.html
Coding style 10344
Coding style Please follow these coding standards when writing code for inclusion in Django. Pre-commit checks pre-commit is a framework for managing pre-commit hooks. These hooks help to identify simple issues before committing code for re ... uld use only plain variable and property access, with prior local variable assignment for more complex cases: # Allowed f "hello { user } " f "hello { user . name } " f "hello { self . user . name } " # Disallowed f "hello { get_user () } " f "you are ... { user . age * 365.25 } days old" # Allowed with local variable assignment user = get_user () f "hello { user } " user_days_old = user . age * 365.25 f "you are { user_days_old } days old" f-strings should not be used for any ...
https://man.mtool.work/django/6.1/internals/contributing/writing-code/coding-sty...
組み込みテンプレートタグとフィルタ 10344
組み込みテンプレートタグとフィルタ このドキュメントでは、 Django の組み込みテンプレートタグとフィルタについて述べます。 また 自動ドキュメンテーション を使えばインストールされている組み込みタグとカスタムタグのドキュメントを読めるのでお勧めで ... るかの例をいくつか示します: {% if "bc" in "abcdef" %} This appears since "bc" is a substring of "abcdef" {% endif %} {% if "hello" in greetings %} If greetings is a list or set, one element of which is the string "hello", this will appear. {% endif %} ... できる最初のものが使用されます。 include されたテンプレートは、include した側のコンテキストにおいて解釈されます。以下の例は "Hello, John!" を出力します: コンテキスト: 変数 person に "John" を、変数 greeting に "Hello" をセット。 テンプレート: {% include ... って、テンプレートに追加のコンテキストを渡すことができます: {% include "name_snippet.html" with person = "Jane" greeting = "Hello" %} あらかじめ準備された変数だけを使って (あるいは変数をまったく使わずに) 出力させたい場合は only オプションを使います。テ ...
https://man.mtool.work/django/6.1/ref/templates/builtins.html
PDFファイルを作成する 9544
PDFファイルを作成する このドキュメントでは、Django のビューを使用して PDF ファイルを動的に出力する方法を説明します。これは、優れたオープンソースの Python PDF ライブラリ ReportLab により可能になっています。 PDF ファイルを動的に生成する利点は ... ジェクトとして振る舞い、Django の FileResponse オブジェクトがファイルライクなオブジェクトを受け取るということです。 ここに、"Hello World"の例を示します: import io from django.http import FileResponse from reportlab.pdfgen import canvas def some_view ( r ... DF generation happens. # See the ReportLab documentation for the full list of functionality. p . drawString ( 100 , 100 , "Hello world." ) # Close the PDF object cleanly, and we're done. p . showPage () p . save () # FileResponse sets the Content-Disp ... present the option to save the file. buffer . seek ( 0 ) return FileResponse ( buffer , as_attachment = True , filename = "hello.pdf" ) コードとコメントが自分自身の意味を説明しているはずですが、いくつかの点には言及しておくべきでしょう。 レスポンスはフ ...
https://man.mtool.work/django/6.1/howto/outputting-pdf.html
フォーム API 9544
フォーム API このドキュメントについて このドキュメントでは、Django のフォーム API の詳細について説明します。このドキュメントを読む前に フォームについての概要 を読むことをおすすめします。 バインドされた (bound) フォームとバインドされていない ... インドするには、辞書型のデータを Form クラスのコンストラクタの最初のパラメータとして渡します。 >>> data = { ... "subject" : "hello" , ... "message" : "Hi there" , ... "contact_email" : "foo@example.com" , ... "urgent" : True , ... } >>> f = ContactForm ... ムの is_bound 属性の値を確認してください。 >>> f = ContactForm () >>> f . is_bound False >>> f = ContactForm ({ "subject" : "hello" }) >>> f . is_bound True 空の辞書を渡すと、データが空の バインドされた フォームが作成されることに注意してください。 >>> f ... lid() メソッドを呼び出して検証を実行し、データが有効であるかどうかを示すブール値を返します。 >>> data = { ... "subject" : "hello" , ... "message" : "Hi there" , ... "contact_email" : "foo@example.com" , ... "urgent" : True , ... } >>> f = ContactForm ...
https://man.mtool.work/django/6.1/ref/forms/api.html
Django ユーティリティ (django.utils) 8582
Django ユーティリティ ( django.utils ) このドキュメントは、 django.utils のすべての安定したモジュールを対象としています。 django.utils 内のほとんどのモジュールは内部使用を目的としていることから、 内部リリース非推奨ポリシー に従い、以下に記載 ... he sharpest minds in online media/journalism/publishing." , ... language = "en" , ... ) >>> feed . add_item ( ... title = "Hello" , ... link = "https://www.holovaty.com/test/" , ... description = "Testing." , ... ) >>> with open ( "test.rss" , "w" ) a ... ップします。 element_id パラメータが None でない場合、 <script> タグに渡されたidが与えられます。例えば: >>> json_script ({ "hello" : "world" }, element_id = "hello-data" ) '<script id="hello-data" type="application/json">{"hello": "world"}</script>' en ... _html() を使用するべきです。 マークされた文字列を安全としても、変更されると再び安全でなくなります。例えば: >>> mystr = "<b>Hello World</b> " >>> mystr = mark_safe ( mystr ) >>> type ( mystr ) <class 'django.utils.safestring.SafeString'> >>> mystr = my ...
https://man.mtool.work/django/6.1/ref/utils.html
ファイルの管理 8582
ファイルの管理 この文書では、ユーザがアップロードしたようなファイルに対する Django のファイルアクセス API について説明します。下位レベルの API は十分一般的なので、他の目的にも使えます。"静的ファイル" (JS や CSS など) を扱いたい場合は、 静的 ... 作成することです: >>> from django.core.files import File # Create a Python file object using open() >>> f = open ( "/path/to/hello.world" , "w" ) >>> myfile = File ( f ) これで、 File クラスのドキュメント化された属性とメソッドのすべてを使えるようになりま ... django.core.files import File # Create a Python file object using open() and the with statement >>> with open ( "/path/to/hello.world" , "w" ) as f : ... myfile = File ( f ) ... myfile . write ( "Hello World" ) ... >>> myfile . closed True >>> f . cl ...
https://man.mtool.work/django/6.1/topics/files.html
テンプレートのバックエンドをカスタマイズする 8418
テンプレートのバックエンドをカスタマイズする カスタムのバックエンド ここでは、他のテンプレートシステムを使用するために、カスタムテンプレートバックエンドを実装する方法を説明します。テンプレートバックエンドは django.template.backends.base.Bas ... : "Invalid block tag: 'syntax'" , "source_lines" : [ ( 1 , "some \n " ), ( 2 , "lines \n " ), ( 3 , "before \n " ), ( 4 , "Hello { % s yntax error %} {{ world }} \n " ), ( 5 , "some \n " ), ( 6 , "lines \n " ), ( 7 , "after \n " ), ( 8 , "" ), ], "lin ... e" : 4 , "before" : "Hello " , "during" : "{ % s yntax error %}" , "after" : " {{ world }} \n " , "total" : 9 , "bottom" : 9 , "top" : 1 , } Origin A ...
https://man.mtool.work/django/6.1/howto/custom-template-backend.html
リレーション先オブジェクトのリファレンス 7945
リレーション先オブジェクトのリファレンス class RelatedManager "関係マネージャ(related manager)"とは、1対多または多対多の関係するコンテキストで使用されるマネージャのことです。これは2つのケースで起こります: ForeignKey リレーションの "反対側 ... く作成されたオブジェクトを返します: >>> b = Blog . objects . get ( id = 1 ) >>> e = b . entry_set . create ( ... headline = "Hello" , body_text = "Hi" , pub_date = datetime . date ( 2005 , 1 , 1 ) ... ) # No need to call e.save() at this point -- it's a ... コードと等価です(しかし、よりシンプルです): >>> b = Blog . objects . get ( id = 1 ) >>> e = Entry ( blog = b , headline = "Hello" , body_text = "Hi" , pub_date = datetime . date ( 2005 , 1 , 1 )) >>> e . save ( force_insert = True ) リレーションシップ ...
https://man.mtool.work/django/6.1/ref/models/relations.html
PREV 1 2 3 NEXT