In Python 3, according to PEP 3333 (amendments to the WSGI standard), we are careful not to mix data coming from or leaving via HTTP, which will be in bytes, as opposed to text within the framework, which will be native (Unicode) strings.
Essentially, for HttpRequest and HttpResponse objects, keep the following in mind:
- Headers will always be str objects
- Input and output streams will always be byte objects
Unlike Python 2, strings and bytes are not implicitly converted while performing comparisons or concatenations with each other. Strings means Unicode strings only.