I was running into this error even with Python 3.6.5 and django 2.0
I noticed 301 redirects in the network tab of the browser debugger. When I fixed them by appending trailing backslashes to all url/api calls in my html/js, this problem went away. The urlconf must have trailing backslashes as well.