per page, with , order by , clip by
Results of 1 - 10 of about 40 for FileField (0.007 sec.)
ファイルのアップロード 12434
ファイルのアップロード Django がファイルアップロードを扱うとき、ファイルデータは request.FILES に格納されます ( request についての詳細は リクエスト/レスポンス オブジェクト を参照してください)。ここでは、ファイルがどのようにディスクとメモリに ... ます!緩和策の詳細は、 ユーザーがアップロードしたコンテンツ のセキュリティガイドをご覧ください。 ファイルのアップロードの基本 FileField を持つフォームを考えてみましょう: forms.py from django import forms class UploadFileForm ( forms . Form ): title = forms . ... CharField ( max_length = 50 ) file = forms . FileField () このフォームをハンドリングするビューは、ファイルのデータを request.FILES というディクショナリの中に受け取ります。このデ ... ィクショナリには、キーと、それぞれのキーに対応するフォームの FileField (または ImageField または他の FileField のサブクラス) が格納されています。そのため、上のフォームから送信されたデータには、 ...
https://man.mtool.work/django/6.1/topics/http/file-uploads.html
ファイルの管理 12107
ファイルの管理 この文書では、ユーザがアップロードしたようなファイルに対する Django のファイルアクセス API について説明します。下位レベルの API は十分一般的なので、他の目的にも使えます。"静的ファイル" (JS や CSS など) を扱いたい場合は、 静的 ... を提供しています。このドキュメントの後半では、それらのストレージシステムの働きについて説明します。 モデルでファイルを使う FileField や ImageField を使うと、 Django はそのファイルを扱うために使える API を提供します。 次のモデルを考えてみましょう。 ImageFi ... . DecimalField ( max_digits = 5 , decimal_places = 2 ) photo = models . ImageField ( upload_to = "cars" ) specs = models . FileField ( upload_to = "specs" ) どの Car インスタンスにも photo 属性があり、それを使って添付写真の詳細を見ることができます: >>> ca ... () >>> car . photo . path '/media/cars/chevy_ii.jpg' >>> car . photo . path == new_path True ディスク上の既存のファイルを FileField に保存します: >>> from pathlib import Path >>> from django.core.files import File >>> path = Path ( "/some/external/specs. ...
https://man.mtool.work/django/6.1/topics/files.html
Django 1.2.5 リリースノート 11124
Django 1.2.5 リリースノート Django 1.2.5 へようこそ! This is the fifth "bugfix" release in the Django 1.2 series, improving the stability and performance of the Django 1.2 codebase. With four exceptions, Django 1.2.5 maintains backwards com ... the documentation for your version of Django, as the exact code necessary is different for some older versions of Django. FileField no longer deletes files In earlier Django versions, when a model instance containing a FileField was deleted, FileField to ... s scenarios, including rolled-back transactions and fields on different models referencing the same file. In Django 1.2.5, FileField will never delete files from the backend storage. If you need cleanup of orphaned files, you'll need to handle it yourself ...
https://man.mtool.work/django/6.1/releases/1.2.5.html
Django 1.3 リリースノート 10796
Django 1.3 リリースノート March 23, 2011 Django 1.3 へようこそ! Nearly a year in the making, Django 1.3 includes quite a few new features and plenty of bug fixes and improvements to existing features. These release notes cover the new featu ... ierarchy . Deleting a model doesn't delete associated files In earlier Django versions, when a model instance containing a FileField was deleted, FileField took it upon itself to also delete the file from the backend storage. This opened the door to sever ... led-back transactions and fields on different models referencing the same file. In Django 1.3, when a model is deleted the FileField 's delete() method won't be called. If you need cleanup of orphaned files, you'll need to handle it yourself (for instance ... 100 ) password = forms . CharField ( widget = forms . PasswordInput ( render_value = True )) Clearable default widget for FileField Django 1.3 now includes a ClearableFileInput form widget in addition to FileInput . ClearableFileInput renders with a chec ...
https://man.mtool.work/django/6.1/releases/1.3.html
モデルフィールドリファレンス 10141
モデルフィールドリファレンス このドキュメントには、Django が提供するフィールドオプション field options とフィールド型 field types を含む、 Field のすべての API リファレンスが記載されています。 注釈 フィールドは django.db.models.fields に定義 ... 254 , ** options ) [ソース] EmailValidator を使って、値が有効なメールアドレスであるかどうかをチェックする CharField です。 FileField class FileField ( upload_to = '' , storage = None , max_length = 100 , ** options ) [ソース] ファイルアップロードのフィール ... ドです。 注釈 primary_key 引数はサポートされておらず、使用するとエラーになります。 以下のオプション引数があります: FileField. upload_to この属性は、アップロードディレクトリとファイル名を設定する方法を提供し、2 つの方法でセットできます。どちらの場合 ... 例えば以下のようにします: class MyModel ( models . Model ): # file will be uploaded to MEDIA_ROOT/uploads upload = models . FileField ( upload_to = "uploads/" ) # or... # file will be saved to MEDIA_ROOT/uploads/2015/01/30 upload = models . FileField ( upl ...
https://man.mtool.work/django/6.1/ref/models/fields.html
Django 2.2.23 リリースノート 9142
Django 2.2.23 リリースノート May 13, 2021 Django 2.2.23 fixes a regression in 2.2.21. バグ修正 Fixed a regression in Django 2.2.21 where saving FileField would raise a SuspiciousFileOperation even when a custom upload_to returns a valid fil ...
https://man.mtool.work/django/6.1/releases/2.2.23.html
Django 3.1.11 リリースノート 9142
Django 3.1.11 リリースノート May 13, 2021 Django 3.1.11 fixes a regression in 3.1.9. バグ修正 Fixed a regression in Django 3.1.9 where saving FileField would raise a SuspiciousFileOperation even when a custom upload_to returns a valid file ...
https://man.mtool.work/django/6.1/releases/3.1.11.html
Django 3.2.3 リリースノート 8815
Django 3.2.3 リリースノート May 13, 2021 Django 3.2.3 では、3.2.2 におけるいくつかのバグを修正しました。 バグ修正 Prepared for mysqlclient > 2.0.3 support ( #32732 ). Fixed a regression in Django 3.2 that caused the incorrect filtering of q ... uerysets combined with the | operator ( #32717 ). Fixed a regression in Django 3.2.1 where saving FileField would raise a SuspiciousFileOperation even when a custom upload_to returns a valid file path ( #32718 ). ...
https://man.mtool.work/django/6.1/releases/3.2.3.html
FAQ: Django を使う 8659
FAQ: Django を使う DJANGO_SETTINGS_MODULE のインポートにまつわるエラーが出るのですが、なぜですか? 以下の点を確認してください: 環境変数 DJANGO_SETTINGS_MODULE が完全指定の Python モジュールになっている (例: mysite.settings )。 その設定モジュ ... ります。 admin だけは Django のデータベースレイヤと密結合しています。 画像やファイルのフィールドはどう使うのですか? モデルで FileField や ImageField を使うには、いくつかのステップを踏む必要があります: 設定ファイル内で MEDIA_ROOT を指定します。この値は、 Dja ... トリの公開 URL にします。ディレクトリは Web サーバのユーザアカウントに対して書き込み可能にしておかねばなりません。 モデルに FileField や ImageField を追加し、 upload_to オプションを定義して、 MEDIA_ROOT のどのサブディレクトリにファイルをアップロードさせるの ...
https://man.mtool.work/django/6.1/faq/usage.html
Django 3.1.2 リリースノート 8331
Django 3.1.2 リリースノート October 1, 2020 Django 3.1.2 では、3.1.1 におけるいくつかのバグを修正しました。 バグ修正 Fixed a bug in Django 3.1 where FileField instances with a callable storage were not correctly deconstructed ( #31941 ). Fi ...
https://man.mtool.work/django/6.1/releases/3.1.2.html
PREV 1 2 3 4 NEXT