且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Django 中重定向到不同的 URL?

更新时间:2023-10-21 14:14:28

您可以使用 HttpResponseRedirect:

You can use HttpResponseRedirect:

from django.http import HttpResponseRedirect

# ...

return HttpResponseRedirect('/url/url1/')

url"在哪里和url1"等于重定向的路径.

Where "url" and "url1" equals the path to the redirect.