diff options
| author | Adam Johnson <me@adamj.eu> | 2023-11-28 16:57:48 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-11-29 11:21:22 +0100 |
| commit | 272ceb9584a68c7df464e8633c02eb4f997da092 (patch) | |
| tree | 1435754076ee8c52358e0dc702cf18d63b3dd04d /docs/topics/forms | |
| parent | 134cde8415b3a9118262ef4ea34cf798c258be03 (diff) | |
Refs #25778 -- Updated some links and references to HTTPS.
Diffstat (limited to 'docs/topics/forms')
| -rw-r--r-- | docs/topics/forms/media.txt | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/docs/topics/forms/media.txt b/docs/topics/forms/media.txt index 5fdd37437e..6e7bfdcbd4 100644 --- a/docs/topics/forms/media.txt +++ b/docs/topics/forms/media.txt @@ -74,9 +74,9 @@ can be retrieved through this property: >>> w = CalendarWidget() >>> print(w.media) - <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> - <script src="http://static.example.com/animations.js"></script> - <script src="http://static.example.com/actions.js"></script> + <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet"> + <script src="https://static.example.com/animations.js"></script> + <script src="https://static.example.com/actions.js"></script> Here's a list of all possible ``Media`` options. There are no required options. @@ -119,9 +119,9 @@ If this last CSS definition were to be rendered, it would become the following H .. code-block:: html+django - <link href="http://static.example.com/pretty.css" media="screen" rel="stylesheet"> - <link href="http://static.example.com/lo_res.css" media="tv,projector" rel="stylesheet"> - <link href="http://static.example.com/newspaper.css" media="print" rel="stylesheet"> + <link href="https://static.example.com/pretty.css" media="screen" rel="stylesheet"> + <link href="https://static.example.com/lo_res.css" media="tv,projector" rel="stylesheet"> + <link href="https://static.example.com/newspaper.css" media="print" rel="stylesheet"> ``js`` ------ @@ -153,11 +153,11 @@ example above: >>> w = FancyCalendarWidget() >>> print(w.media) - <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> - <link href="http://static.example.com/fancy.css" media="all" rel="stylesheet"> - <script src="http://static.example.com/animations.js"></script> - <script src="http://static.example.com/actions.js"></script> - <script src="http://static.example.com/whizbang.js"></script> + <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet"> + <link href="https://static.example.com/fancy.css" media="all" rel="stylesheet"> + <script src="https://static.example.com/animations.js"></script> + <script src="https://static.example.com/actions.js"></script> + <script src="https://static.example.com/whizbang.js"></script> The FancyCalendar widget inherits all the assets from its parent widget. If you don't want ``Media`` to be inherited in this way, add @@ -176,8 +176,8 @@ an ``extend=False`` declaration to the ``Media`` declaration: >>> w = FancyCalendarWidget() >>> print(w.media) - <link href="http://static.example.com/fancy.css" media="all" rel="stylesheet"> - <script src="http://static.example.com/whizbang.js"></script> + <link href="https://static.example.com/fancy.css" media="all" rel="stylesheet"> + <script src="https://static.example.com/whizbang.js"></script> If you require even more control over inheritance, define your assets using a :ref:`dynamic property <dynamic-property>`. Dynamic properties give you @@ -230,7 +230,7 @@ render a complete web page. To find the appropriate prefix to use, Django will check if the :setting:`STATIC_URL` setting is not ``None`` and automatically fall back to using :setting:`MEDIA_URL`. For example, if the :setting:`MEDIA_URL` for -your site was ``'http://uploads.example.com/'`` and :setting:`STATIC_URL` +your site was ``'https://uploads.example.com/'`` and :setting:`STATIC_URL` was ``None``: .. code-block:: pycon @@ -241,24 +241,24 @@ was ``None``: ... css = { ... "all": ["/css/pretty.css"], ... } - ... js = ["animations.js", "http://othersite.com/actions.js"] + ... js = ["animations.js", "https://othersite.com/actions.js"] ... >>> w = CalendarWidget() >>> print(w.media) <link href="/css/pretty.css" media="all" rel="stylesheet"> - <script src="http://uploads.example.com/animations.js"></script> - <script src="http://othersite.com/actions.js"></script> + <script src="https://uploads.example.com/animations.js"></script> + <script src="https://othersite.com/actions.js"></script> -But if :setting:`STATIC_URL` is ``'http://static.example.com/'``: +But if :setting:`STATIC_URL` is ``'https://static.example.com/'``: .. code-block:: pycon >>> w = CalendarWidget() >>> print(w.media) <link href="/css/pretty.css" media="all" rel="stylesheet"> - <script src="http://static.example.com/animations.js"></script> - <script src="http://othersite.com/actions.js"></script> + <script src="https://static.example.com/animations.js"></script> + <script src="https://othersite.com/actions.js"></script> Or if :mod:`~django.contrib.staticfiles` is configured using the :class:`~django.contrib.staticfiles.storage.ManifestStaticFilesStorage`: @@ -269,7 +269,7 @@ Or if :mod:`~django.contrib.staticfiles` is configured using the >>> print(w.media) <link href="/css/pretty.css" media="all" rel="stylesheet"> <script src="https://static.example.com/animations.27e20196a850.js"></script> - <script src="http://othersite.com/actions.js"></script> + <script src="https://othersite.com/actions.js"></script> Paths as objects ---------------- @@ -316,12 +316,12 @@ operator to filter out a medium of interest. For example: >>> w = CalendarWidget() >>> print(w.media) - <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> - <script src="http://static.example.com/animations.js"></script> - <script src="http://static.example.com/actions.js"></script> + <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet"> + <script src="https://static.example.com/animations.js"></script> + <script src="https://static.example.com/actions.js"></script> >>> print(w.media["css"]) - <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> + <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet"> When you use the subscript operator, the value that is returned is a new ``Media`` object -- but one that only contains the media of interest. @@ -352,10 +352,10 @@ specified by both: >>> w1 = CalendarWidget() >>> w2 = OtherWidget() >>> print(w1.media + w2.media) - <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> - <script src="http://static.example.com/animations.js"></script> - <script src="http://static.example.com/actions.js"></script> - <script src="http://static.example.com/whizbang.js"></script> + <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet"> + <script src="https://static.example.com/animations.js"></script> + <script src="https://static.example.com/actions.js"></script> + <script src="https://static.example.com/whizbang.js"></script> .. _form-media-asset-order: @@ -383,10 +383,10 @@ For example: >>> w1 = CalendarWidget() >>> w2 = TimeWidget() >>> print(w1.media + w2.media) - <script src="http://static.example.com/jQuery.js"></script> - <script src="http://static.example.com/calendar.js"></script> - <script src="http://static.example.com/time.js"></script> - <script src="http://static.example.com/noConflict.js"></script> + <script src="https://static.example.com/jQuery.js"></script> + <script src="https://static.example.com/calendar.js"></script> + <script src="https://static.example.com/time.js"></script> + <script src="https://static.example.com/noConflict.js"></script> Combining ``Media`` objects with assets in a conflicting order results in a ``MediaOrderConflictWarning``. @@ -415,10 +415,10 @@ are part of the form: >>> f = ContactForm() >>> f.media - <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> - <script src="http://static.example.com/animations.js"></script> - <script src="http://static.example.com/actions.js"></script> - <script src="http://static.example.com/whizbang.js"></script> + <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet"> + <script src="https://static.example.com/animations.js"></script> + <script src="https://static.example.com/actions.js"></script> + <script src="https://static.example.com/whizbang.js"></script> If you want to associate additional assets with a form -- for example, CSS for form layout -- add a ``Media`` declaration to the form: @@ -436,8 +436,8 @@ CSS for form layout -- add a ``Media`` declaration to the form: >>> f = ContactForm() >>> f.media - <link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> - <link href="http://static.example.com/layout.css" media="all" rel="stylesheet"> - <script src="http://static.example.com/animations.js"></script> - <script src="http://static.example.com/actions.js"></script> - <script src="http://static.example.com/whizbang.js"></script> + <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet"> + <link href="https://static.example.com/layout.css" media="all" rel="stylesheet"> + <script src="https://static.example.com/animations.js"></script> + <script src="https://static.example.com/actions.js"></script> + <script src="https://static.example.com/whizbang.js"></script> |
