Is it an error by Django?

2017-10-05 Thread utpalbrahma1995
The below code looks wierd. def __init__(self, content=b'', *args, **kwargs): super(HttpResponse, self).__init__(*args, **kwargs) # Content is a bytestring. See the `content` property methods. self.content = content The wierd part is /// content=b''/// -- You received

Re: Is it an error by Django?

2017-10-05 Thread Lachlan Musicman
I'd imagine that's the new Python3 system. content is a bytestring, not unicode? Cheers L. -- "The antidote to apocalypticism is *apocalyptic civics*. Apocalyptic civics is the insistence that we cannot ignore the truth, nor should we panic about it. It is a shared consciousness that our inst

Re: Is it an error by Django?

2017-10-05 Thread Lachlan Musicman
Yeah, if you look in the docs here https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals "Bytes literals are always prefixed with 'b' or 'B'; they produce an instance of the bytes type instead of the str

Re: Is it an error by Django?

2017-10-06 Thread utpalbrahma1995
Well Lachlan Thank you very much. -- 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+unsubscr...@googlegroups.com. To post to this group, send ema

Re: Is it an error by Django?

2017-10-06 Thread utpalbrahma1995
I have a doubt As per your given link i guess it should be like content=' b ' -- 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+

Re: Is it an error by Django?

2017-10-06 Thread Andréas Kühne
Hi, No, the correct format is content=b'' otherwise you would just be default content to a string that equals "b". It says that there is no encoding on the string afterwards and it is a byte string. It works the same way Python 2 used to do with unicode strings, in that case it was

Re: Is it an error by Django?

2017-10-14 Thread utpalbrahma1995
Thank you Andréas Kühne -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-us