swapi
swapi copied to clipboard
runserver serves with HTTP/1.0
This is a known issue with django, that has been fixed, but not yet in 1.7.4. The problem is, Chrome doesn't work with ETag if the server uses HTTP/1.0.
Are there any plans to upgrade django or we should better consider monkey patching it locally?
Have found out that the fix in question was moved to release 2.0, that is not ready yet.
Currently, to get HTTP 1.1 responses in dev environment, I would suggest to use gunicorn from required packages:
gunicorn swapi.wsgi --log-file -
It wouldn't serve static files, though dj_static could help. For working with json output from API you might not need static at all.
This way, with HTTP 1.1, it's possible to see the correct work of ETag in dev environment
with the following javascript:
fetch('http://lvh.me:8000/api/')
Here lvh.me is used to make cross-origin request from localhost.