I love it. If URLField has an option like "scheme_required=False" or something like that. No behaviour is the "correct", append or not append scheme. The option to our needs seems to be more correct.
Regards, On Wed, Apr 3, 2013 at 5:14 PM, SteveB <[email protected]> wrote: > How to avoid those browser warnings about mixing secure and insecure > content on a web page? > Wouldn't it be great to be able to specify a URL for a resource (be it a > script, image, iframe etc.) such that if the current page is insecure > (using a http:// scheme) the content would be fetched using the same > scheme? > And when the current page is secure (using a https:// scheme) the > resource would also be fetched as if it had a https scheme? > > Well you can, just leave out the scheme in the URL. That is, specify it as > "//example.com/some/path/" and the browser will apply the same scheme as > the parent page. > > Great! - But, it is not possible to specify a URL such as this in a Django > URLField. Thanks to https://code.djangoproject.com/ticket/5331, a blank > scheme will be cause the field verification to insert "http" as the scheme, > and you lose the flexibility described above. > It is currently not possible (in Django 1.5.1) to get a URLField > validating with a blank scheme, so the ability to specify a URL for a > resource which can be follow the scheme of the parent page is not possible. > > I content that the 5331 ticket may not have taken into account the > flexibility which the empty scheme offers on web pages, and I urge that it > be reconsidered. > > What do folks think? > SB > > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/django-developers?hl=en > . > For more options, visit https://groups.google.com/groups/opt_out. > > > -- juanpex -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
