I'm experiencing this problem since recently, I guess after upgrading to Django 1.9.
I had originally this problem with DRF
https://github.com/tomchristie/django-rest-framework/issues/3724
but I adapted it to Django.
With the following code I can reproduce the problem. The problem happens with Apache and not with the built-in Django web server.
from __future__ import unicode_literals
from django.views.generic import View
from django.http import HttpResponse
class Test200(View):
def get(self, request, *args, **kwargs):
response = HttpResponse(status=200)
response['Location'] = '/'
return response
class Test202(View):
def get(self, request, *args, **kwargs):
response = HttpResponse(status=202)
response['Location'] = '/'
return response
[...]
url(r'^test200/$', Test200.as_view()),
url(r'^test202/$', Test202.as_view()),
With the Django built-in server, I get the correct status code and no content in both cases.
With Apache on production I get nothing from the second view, meanwhile from the first view I get the content of the main page (that is the content of "/") even if the URL remains "/test200/".
Can someone reproduce the problem? Is it an Apache misconfiguration?
Thanks,
Andrea
-- I had originally this problem with DRF
https://github.com/tomchristie/django-rest-framework/issues/3724
but I adapted it to Django.
With the following code I can reproduce the problem. The problem happens with Apache and not with the built-in Django web server.
from __future__ import unicode_literals
from django.views.generic import View
from django.http import HttpResponse
class Test200(View):
def get(self, request, *args, **kwargs):
response = HttpResponse(status=200)
response['Location'] = '/'
return response
class Test202(View):
def get(self, request, *args, **kwargs):
response = HttpResponse(status=202)
response['Location'] = '/'
return response
[...]
url(r'^test200/$', Test200.as_view()),
url(r'^test202/$', Test202.as_view()),
With the Django built-in server, I get the correct status code and no content in both cases.
With Apache on production I get nothing from the second view, meanwhile from the first view I get the content of the main page (that is the content of "/") even if the URL remains "/test200/".
Can someone reproduce the problem? Is it an Apache misconfiguration?
Thanks,
Andrea
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f20c9dbd-60fd-40e1-a31d-9da9845215c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment