Thursday, March 27, 2014

Re: Avoid Django s3-urls stripping

Is the url a bytestring? A quick check of the code for HttpResponse
shows that that class is expecting a byte string. Perhaps the URL
contains unicode characters that aren't being escaped properly?

Aaron

On 3/27/14, Aaron Cannon <cannona@fireantproductions.com> wrote:
> Other things I'd probably try to debug this issue would be:
>
> * Hard coding the string into the call to HttpResponse,
> * printing the variable that contains the URL to the console.
>
> If the URL was still bad after trying the first item, and the second
> item printed the expected result, then you could completely take S3
> out of the picture. From there, I would start narrowing it down, to
> see if it was a specific character that was causing the problem.
>
> Narrowing things down a bit more might make it easier for folks to
> help you figure out your issue.
>
> Luck.
>
> Aaron
>
> On 3/27/14, Paolo Bertasi <paolo.bert@gmail.com> wrote:
>> Hi Aaron,
>> the html is "wrong" as well.
>>
>> Moreover i tried {% autoescape off %} but with no luck :(
>>
>>
>>
>>
>> Il giorno giovedì 27 marzo 2014 17:24:45 UTC+1, Aaron Cannon ha scritto:
>>>
>>> Try clicking view source in your browser when you view it. Perhaps
>>> the URL needs to be HTML escaped?
>>>
>>> Just a guess.
>>>
>>> Aaron
>>>
>>> On 3/21/14, Paolo Bertasi <paolo...@gmail.com <javascript:>> wrote:
>>> > Hello,
>>> > I'm trying to setup a mini django app to allow users to download files
>>> from
>>> >
>>> > s3. I wrote a simple python function (using boto of course) to fetch
>>> > the
>>> >
>>> > correct url but when i handle the url with django the url is stripped.
>>> > I wrote down the exact behaviour
>>> > here<
>>> http://stackoverflow.com/questions/22531195/avoid-django-s3-urls-stripping>
>>>
>>>
>>> > .
>>> >
>>> > Please help :)
>>> >
>>> > --
>>> > 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...@googlegroups.com <javascript:>.
>>> > To post to this group, send email to
>>> > django...@googlegroups.com<javascript:>.
>>>
>>> > Visit this group at http://groups.google.com/group/django-users.
>>> > To view this discussion on the web visit
>>> >
>>> https://groups.google.com/d/msgid/django-users/e3dba710-5189-4800-b455-09868dcf578b%40googlegroups.com.
>>>
>>>
>>> > For more options, visit https://groups.google.com/d/optout.
>>> >
>>>
>>
>> --
>> 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+unsubscribe@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/1172243d-6d55-41b4-9cf4-a6bbc6379225%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAERFoOjPWjRwkCY%2BG-BtLO6XL8Sc-pK3TWBa%3D01aRPLP%2BVZCZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment