I\'m getting a weird error that I can\'t seem to find a solution for.
This error does not occur every time I hit this segment of code, and neither does it happen for
This doesn't have anything to do with Django, it's an exception thrown by urllib2 which couldn't parse the response after fetching your url. It may be a network issue, a malformed response… Some servers / applications throw this kind of error randomly. If you don't control what this URL returns you're left with catching the exception, debugging which URLs are causing problems and trying to identify a pattern.