Django returning HTTP 301?

前端 未结 3 785
礼貌的吻别
礼貌的吻别 2020-12-04 21:14

I have a django view that returns HTTP 301 on a curl request:

grapefruit:~ pete$ curl -I http://someurl
HTTP/1.1 301 MOVED PERMANENTLY
Date: Fri, 16 Oct 2009         


        
3条回答
  •  余生分开走
    2020-12-04 21:56

    You are probably requesting the URL without a trailing slash, and have APPEND_SLASH set to True (the default) in settings.py, so Django is redirecting to the URL including a slash.

提交回复
热议问题