per page, with , order by , clip by
Results of 1 - 10 of about 24 for HttpResponseRedirect (0.002 sec.)
はじめての Django アプリ作成、その 4 11676
はじめての Django アプリ作成、その 4 このチュートリアルは チュートリアルその 3 の続きです。ここでは、引き続きWeb投票アプリケーションの開発を例にして、簡単なフォー ム処理とコードの縮小化を中心に解説します。 困ったときは: このチュートリアルの ... 下を polls/views.py に追加してください: polls/views.py from django.db.models import F from django.http import HttpResponse , HttpResponseRedirect from django.shortcuts import get_object_or_404 , render from django.urls import reverse from .models import Choice , Quest ... t select a choice." , }, ) else : selected_choice . votes = F ( "votes" ) + 1 selected_choice . save () # Always return an HttpResponseRedirect after successfully dealing # with POST data. This prevents data from being posted twice if a # user hits the Back button. ... return HttpResponseRedirect ( reverse ( "polls:results" , args = ( question . id ,))) このコードには、これまでのチュートリアルで扱っていなかったことが ...
https://man.mtool.work/django/6.1/intro/tutorial04.html
Django 4.2.26 リリースノート 11509
Django 4.2.26 リリースノート 2025年11月5日 Django 4.2.26 fixes one security issue with severity "high" and one security issue with severity "moderate" in 4.2.25. CVE-2025-64458: Potential denial-of-service vulnerability in HttpResponseRedirect ... ect and HttpResponsePermanentRedirect on Windows Python's NFKC normalization is slow on Windows. As a consequence, HttpResponseRedirect , HttpResponsePermanentRedirect , and the shortcut redirect() were subject to a potential denial-of-service attack via cer ...
https://man.mtool.work/django/6.1/releases/4.2.26.html
Django 5.1.14 リリースノート 11509
Django 5.1.14 リリースノート 2025年11月5日 Django 5.1.14 fixes one security issue with severity "high" and one security issue with severity "moderate" in 5.1.13. CVE-2025-64458: Potential denial-of-service vulnerability in HttpResponseRedirect ... ect and HttpResponsePermanentRedirect on Windows Python's NFKC normalization is slow on Windows. As a consequence, HttpResponseRedirect , HttpResponsePermanentRedirect , and the shortcut redirect() were subject to a potential denial-of-service attack via cer ...
https://man.mtool.work/django/6.1/releases/5.1.14.html
Django 5.2.8 リリースノート 10808
Django 5.2.8 リリースノート 2025年11月5日 Django 5.2.8 fixes one security issue with severity "high", one security issue with severity "moderate", and several bugs in 5.2.7. It also adds compatibility with Python 3.14. CVE-2025-64458: Poten ... tial denial-of-service vulnerability in HttpResponseRedirect and HttpResponsePermanentRedirect on Windows Python's NFKC normalization is slow on Windows. As a consequence, HttpRespons ...
https://man.mtool.work/django/6.1/releases/5.2.8.html
ファイルのアップロード 10458
ファイルのアップロード Django がファイルアップロードを扱うとき、ファイルデータは request.FILES に格納されます ( request についての詳細は リクエスト/レスポンス オブジェクト を参照してください)。ここでは、ファイルがどのようにディスクとメモリに ... に、 request からフォームへデータを引き渡せばよいでしょう。その場合、下記のようになります: views.py from django.http import HttpResponseRedirect from django.shortcuts import render from .forms import UploadFileForm # Imaginary function to handle an uploaded file. fro ... Form ( request . POST , request . FILES ) if form . is_valid (): handle_uploaded_file ( request . FILES [ "file" ]) return HttpResponseRedirect ( "/success/url/" ) else : form = UploadFileForm () return render ( request , "upload.html" , { "form" : form }) ここで、 ... 、 form.save() を呼び出すだけで、対応する FileField の upload_to 引数で指定した場所に保存されます。 from django.http import HttpResponseRedirect from django.shortcuts import render from .forms import ModelFormWithFileField def upload_file ( request ): if request . me ...
https://man.mtool.work/django/6.1/topics/http/file-uploads.html
django.urls ユーティリティ関数 9591
django.urls ユーティリティ関数 reverse() reverse() 関数は指定したビューと任意のパラメータに対して、 url タグと同様に、絶対パス参照を返すために使用します。 reverse ( viewname , urlconf = None , args = None , kwargs = None , current_app = Non ... 受け入れる場合は、 args にそれらを渡すことができます。例えば: from django.urls import reverse def myview ( request ): return HttpResponseRedirect ( reverse ( "arch-summary" , args = [ 1945 ])) kwargs を args の代わりに渡すこともできます。例えば: >>> reverse ( "admin:a ... かをテストすることです。 from urllib.parse import urlsplit from django.urls import resolve from django.http import Http404 , HttpResponseRedirect def myview ( request ): next = request . META . get ( "HTTP_REFERER" , None ) or "/" response = HttpResponseRedirect ( nex ... olve ( urlsplit ( next ) . path ) kwargs [ "request" ] = request try : view ( * args , ** kwargs ) except Http404 : return HttpResponseRedirect ( "/" ) return response get_script_prefix() get_script_prefix () [ソース] 通常、アプリケーション内でURLを定義する際には、常 ...
https://man.mtool.work/django/6.1/ref/urlresolvers.html
クラスベースビュー入門 8890
クラスベースビュー入門 クラスベースビューはビューを実装するもう一つの手段で、関数の代わりに Python のオブジェクトとしてビューを定義します。クラスベースビューは関数ベースのビューを完全に置き換えるものではありませんが、関数ベースのビューと比較 ... ースのビューでフォームを扱う フォームを扱う基本の関数ベースのビューは、次のようなコードになります。 from django.http import HttpResponseRedirect from django.shortcuts import render from .forms import MyForm def myview ( request ): if request . method == "POST" : form ... = MyForm ( request . POST ) if form . is_valid (): # <process form cleaned data> return HttpResponseRedirect ( "/success/" ) else : form = MyForm ( initial = { "key" : "value" }) return render ( request , "form_template.html" , { " ... form" : form }) 同等のクラスベースのビューは、次のようになるでしょう。 from django.http import HttpResponseRedirect from django.shortcuts import render from django.views import View from .forms import MyForm class MyFormView ( View ): for ...
https://man.mtool.work/django/6.1/topics/class-based-views/intro.html
Django 4.2.27 リリースノート 8723
Django 4.2.27 リリースノート 2025年12月2日 Django 4.2.27 fixes one security issue with severity "high", one security issue with severity "moderate", and one bug in 4.2.26. CVE-2025-13372: Potential SQL injection in FilteredRelation column a ... nt, avoiding excessive resource usage. バグ修正 Fixed a regression in Django 4.2.26 where DisallowedRedirect was raised by HttpResponseRedirect and HttpResponsePermanentRedirect for URLs longer than 2048 characters. The limit is now 16384 characters ( #36743 ). ...
https://man.mtool.work/django/6.1/releases/4.2.27.html
Django 5.1.15 リリースノート 8723
Django 5.1.15 リリースノート 2025年12月2日 Django 5.1.15 fixes one security issue with severity "high", one security issue with severity "moderate", and one bug in 5.1.14. CVE-2025-13372: Potential SQL injection in FilteredRelation column a ... nt, avoiding excessive resource usage. バグ修正 Fixed a regression in Django 5.1.14 where DisallowedRedirect was raised by HttpResponseRedirect and HttpResponsePermanentRedirect for URLs longer than 2048 characters. The limit is now 16384 characters ( #36743 ). ...
https://man.mtool.work/django/6.1/releases/5.1.15.html
Django 5.2.9 リリースノート 8373
Django 5.2.9 リリースノート 2025年12月2日 Django 5.2.9 fixes one security issue with severity "high", one security issue with severity "moderate", and several bugs in 5.2.8. CVE-2025-13372: Potential SQL injection in FilteredRelation column ... ter over a queryset with annotations ( #36751 ). Fixed a regression in Django 5.2.8 where DisallowedRedirect was raised by HttpResponseRedirect and HttpResponsePermanentRedirect for URLs longer than 2048 characters. The limit is now 16384 characters ( #36743 ). Fixe ...
https://man.mtool.work/django/6.1/releases/5.2.9.html
PREV 1 2 3 NEXT