Django 2.2.x DocumentationGeneral string handling Models Templates Files Form submission django.urls utility functions reverse() reverse_lazy() resolve() get_script_prefix() django.urls functions for use in URLconfs path() re_path() HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .models import Choice, Question # ... def vote(request, question_id): question = get_o being posted twice if a # user hits the Back button. return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) This code includes a few things we haven’t covered yet in0 码力 | 2915 页 | 2.83 MB | 1 年前3
Django 3.0.x DocumentationGeneral string handling Models Templates Files Form submission django.urls utility functions reverse() reverse_lazy() resolve() get_script_prefix() django.urls functions for use in URLconfs path() re_path() HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .models import Choice, Question # ... def vote(request, question_id): question = get_o being posted twice if a # user hits the Back button. return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) This code includes a few things we haven’t covered yet in0 码力 | 3085 页 | 2.95 MB | 1 年前3
Django 3.1.x DocumentationGeneral string handling Models Templates Files Form submission django.urls utility functions reverse() reverse_lazy() resolve() get_script_prefix() django.urls functions for use in URLconfs path() re_path() HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .models import Choice, Question # ... def vote(request, question_id): question = get_o being posted twice if a # user hits the Back button. return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) This code includes a few things we haven’t covered yet in0 码力 | 3094 页 | 3.03 MB | 1 年前3
Django 4.2.x DocumentationGeneral string handling Models Templates Files Form submission django.urls utility functions reverse() reverse_lazy() resolve() get_script_prefix() django.urls functions for use in URLconfs path() re_path() HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .models import Choice, Question # ... def vote(request, question_id): question = get_ being posted twice if a # user hits the Back button. return HttpResponseRedirect(reverse("polls:results", args=(question.id,))) This code includes a few things we haven’t covered yet in0 码力 | 3305 页 | 3.16 MB | 1 年前3
Django 4.1.x DocumentationGeneral string handling Models Templates Files Form submission django.urls utility functions reverse() reverse_lazy() resolve() get_script_prefix() django.urls functions for use in URLconfs path() re_path() HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .models import Choice, Question # ... def vote(request, question_id): question = get_o being posted twice if a # user hits the Back button. return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) This code includes a few things we haven’t covered yet in0 码力 | 3240 页 | 3.13 MB | 1 年前3
Django 4.0.x DocumentationGeneral string handling Models Templates Files Form submission django.urls utility functions reverse() reverse_lazy() resolve() get_script_prefix() django.urls functions for use in URLconfs path() re_path() HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .models import Choice, Question # ... def vote(request, question_id): question = get_o being posted twice if a # user hits the Back button. return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) This code includes a few things we haven’t covered yet in0 码力 | 3184 页 | 3.14 MB | 1 年前3
Django 4.0.x DocumentationHttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .models import Choice, Question # ... def vote(request, question_id): question = get_object_or_404(Question prevents data from being posted twice if a # user hits the Back button. return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) This code includes a few things we haven’t covered yet in tip isn’t specific to Django; it’s good web development practice in general. • We are using the reverse() function in the HttpResponseRedirect constructor in this example. This function helps avoid having0 码力 | 2248 页 | 7.90 MB | 1 年前3
Django 3.2.x DocumentationGeneral string handling Models Templates Files Form submission django.urls utility functions reverse() reverse_lazy() resolve() get_script_prefix() django.urls functions for use in URLconfs path() re_path() HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .models import Choice, Question # ... def vote(request, question_id): question = get_o being posted twice if a # user hits the Back button. return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) This code includes a few things we haven’t covered yet in0 码力 | 3121 页 | 3.08 MB | 1 年前3
Django 3.2.x DocumentationHttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .models import Choice, Question # ... def vote(request, question_id): question = get_object_or_404(Question prevents data from being posted twice if a # user hits the Back button. return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) This code includes a few things we haven’t covered yet in tip isn’t specific to Django; it’s good Web development practice in general. • We are using the reverse() function in the HttpResponseRedirect constructor in this example. This function helps avoid having0 码力 | 2199 页 | 7.89 MB | 1 年前3
Django 3.0.x DocumentationHttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .models import Choice, Question # ... def vote(request, question_id): question = get_object_or_404(Question prevents data from being posted twice if a # user hits the Back button. return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) This code includes a few things we haven’t covered yet in tip isn’t specific to Django; it’s good Web development practice in general. • We are using the reverse() function in the HttpResponseRedirect constructor in this example. This function helps avoid having0 码力 | 2002 页 | 6.73 MB | 1 年前3
共 92 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10













