Re: 301 vs 308 in default redirect class for CommonMiddleware

2018-09-26 Thread Adam Johnson
I don't think it's worth the deprecation path to rename the old classes - it doesn't seem like there's a substantial benefit to using the different codes and getting everyone to change their imports is a lot of work to impose on the world. There must be some name for the 308 one that would work, b

Re: 301 vs 308 in default redirect class for CommonMiddleware

2018-09-22 Thread Matthieu Bonnefoy
Hi Adam, Thanks for your reply. I agree, I think that would be a nice addition. The issue we’ll have is that the current naming of the HttpResponsePermanentRedirect (301 Moved Permanently) will be confusing. existing - HttpResponsePermanentRedirect (301 Moved Permanently) => should probably b

Re: 301 vs 308 in default redirect class for CommonMiddleware

2018-09-18 Thread Adam Johnson
This is historical, 307 and 308 were added later, and I think we couldn't change it without breaking backwards compatibility. That said, 307 and 308 classes could be added to django.http.response and the documentation could recommend their use. Mozilla docs show that they're compatible with all tra

301 vs 308 in default redirect class for CommonMiddleware

2018-09-18 Thread Matthieu Bonnefoy
Hi there, I am wondering why the default redirect class in the common middleware is a 301 Moved Permanently response. https://github.com/django/django/blob/master/django/middleware/common.py#L32 https://github.com/django/django/blob/master/django/http/response.py#L476 I just got the issue of a P