1
0
mirror of https://github.com/django/django.git synced 2025-01-03 15:06:09 +00:00

Refs #25778 -- Updated some links and references to HTTPS.

This commit is contained in:
Adam Johnson 2023-11-28 16:57:48 +00:00 committed by Mariusz Felisiak
parent 134cde8415
commit 272ceb9584
13 changed files with 62 additions and 62 deletions

View File

@ -1,4 +1,4 @@
All icons are taken from Font Awesome (http://fontawesome.io/) project. All icons are taken from Font Awesome (https://fontawesome.com/) project.
The Font Awesome font is licensed under the SIL OFL 1.1: The Font Awesome font is licensed under the SIL OFL 1.1:
- https://scripts.sil.org/OFL - https://scripts.sil.org/OFL

View File

@ -15,7 +15,7 @@ printer-friendly NCAA tournament brackets, as PDF files, for people
participating in a March Madness contest. participating in a March Madness contest.
.. _ReportLab: https://docs.reportlab.com/ .. _ReportLab: https://docs.reportlab.com/
.. _kusports.com: http://www2.kusports.com/ .. _kusports.com: https://www2.kusports.com/
Install ReportLab Install ReportLab
================= =================

View File

@ -27,7 +27,7 @@ template system a programmer uses.
Although Django comes with a full stack for convenience, the pieces of the Although Django comes with a full stack for convenience, the pieces of the
stack are independent of another wherever possible. stack are independent of another wherever possible.
.. _`loose coupling and tight cohesion`: http://wiki.c2.com/?CouplingAndCohesion .. _`loose coupling and tight cohesion`: https://wiki.c2.com/?CouplingAndCohesion
.. _less-code: .. _less-code:
@ -66,7 +66,7 @@ as possible.
The `discussion of DRY on the Portland Pattern Repository`__ The `discussion of DRY on the Portland Pattern Repository`__
__ http://wiki.c2.com/?DontRepeatYourself __ https://wiki.c2.com/?DontRepeatYourself
.. _explicit-is-better-than-implicit: .. _explicit-is-better-than-implicit:

View File

@ -1980,7 +1980,7 @@ For instance:
# Read a raster as a file object from a remote source. # Read a raster as a file object from a remote source.
>>> from urllib.request import urlopen >>> from urllib.request import urlopen
>>> dat = urlopen("http://example.com/raster.tif").read() >>> dat = urlopen("https://example.com/raster.tif").read()
# Instantiate a raster from the bytes object. # Instantiate a raster from the bytes object.
>>> rst = GDALRaster(dat) >>> rst = GDALRaster(dat)
# The name starts with /vsimem/, indicating that the raster lives in the # The name starts with /vsimem/, indicating that the raster lives in the

View File

@ -568,7 +568,7 @@ generate a Google News compatible sitemap:
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<urlset <urlset
xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns="https://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"> xmlns:news="https://www.google.com/schemas/sitemap-news/0.9">
{% spaceless %} {% spaceless %}
{% for url in urlset %} {% for url in urlset %}
<url> <url>

View File

@ -246,7 +246,7 @@ Getting the current domain for full URLs
Django's ``get_absolute_url()`` convention is nice for getting your objects' Django's ``get_absolute_url()`` convention is nice for getting your objects'
URL without the domain name, but in some cases you might want to display the URL without the domain name, but in some cases you might want to display the
full URL -- with ``http://`` and the domain and everything -- for an object. full URL -- with ``https://`` and the domain and everything -- for an object.
To do this, you can use the sites framework. An example: To do this, you can use the sites framework. An example:
.. code-block:: pycon .. code-block:: pycon

View File

@ -532,7 +532,7 @@ This example illustrates all possible attributes and methods for a
# AUTHOR LINK --One of the following three is optional. The framework # AUTHOR LINK --One of the following three is optional. The framework
# looks for them in this order. In each case, the URL should include # looks for them in this order. In each case, the URL should include
# the "http://" and domain name. # the scheme (such as "https://") and domain name.
def author_link(self, obj): def author_link(self, obj):
""" """
@ -735,7 +735,7 @@ This example illustrates all possible attributes and methods for a
# ITEM AUTHOR LINK -- One of the following three is optional. The # ITEM AUTHOR LINK -- One of the following three is optional. The
# framework looks for them in this order. In each case, the URL should # framework looks for them in this order. In each case, the URL should
# include the "http://" and domain name. # include the scheme (such as "https://") and domain name.
# #
# If you specify this, you must specify item_author_name. # If you specify this, you must specify item_author_name.

View File

@ -173,13 +173,13 @@ field is initialized to a particular value. For example:
>>> from django import forms >>> from django import forms
>>> class CommentForm(forms.Form): >>> class CommentForm(forms.Form):
... name = forms.CharField(initial="Your name") ... name = forms.CharField(initial="Your name")
... url = forms.URLField(initial="http://") ... url = forms.URLField(initial="https://")
... comment = forms.CharField() ... comment = forms.CharField()
... ...
>>> f = CommentForm(auto_id=False) >>> f = CommentForm(auto_id=False)
>>> print(f) >>> print(f)
<div>Name:<input type="text" name="name" value="Your name" required></div> <div>Name:<input type="text" name="name" value="Your name" required></div>
<div>Url:<input type="url" name="url" value="http://" required></div> <div>Url:<input type="url" name="url" value="https://" required></div>
<div>Comment:<input type="text" name="comment" required></div> <div>Comment:<input type="text" name="comment" required></div>
You may be thinking, why not just pass a dictionary of the initial values as You may be thinking, why not just pass a dictionary of the initial values as
@ -193,7 +193,7 @@ and the HTML output will include any validation errors:
... url = forms.URLField() ... url = forms.URLField()
... comment = forms.CharField() ... comment = forms.CharField()
... ...
>>> default_data = {"name": "Your name", "url": "http://"} >>> default_data = {"name": "Your name", "url": "https://"}
>>> f = CommentForm(default_data, auto_id=False) >>> f = CommentForm(default_data, auto_id=False)
>>> print(f) >>> print(f)
<div>Name: <div>Name:
@ -201,7 +201,7 @@ and the HTML output will include any validation errors:
</div> </div>
<div>Url: <div>Url:
<ul class="errorlist"><li>Enter a valid URL.</li></ul> <ul class="errorlist"><li>Enter a valid URL.</li></ul>
<input type="url" name="url" value="http://" required aria-invalid="true"> <input type="url" name="url" value="https://" required aria-invalid="true">
</div> </div>
<div>Comment: <div>Comment:
<ul class="errorlist"><li>This field is required.</li></ul> <ul class="errorlist"><li>This field is required.</li></ul>
@ -219,7 +219,7 @@ validation if a particular field's value is not given. ``initial`` values are
>>> class CommentForm(forms.Form): >>> class CommentForm(forms.Form):
... name = forms.CharField(initial="Your name") ... name = forms.CharField(initial="Your name")
... url = forms.URLField(initial="http://") ... url = forms.URLField(initial="https://")
... comment = forms.CharField() ... comment = forms.CharField()
... ...
>>> data = {"name": "", "url": "", "comment": "Foo"} >>> data = {"name": "", "url": "", "comment": "Foo"}

View File

@ -2096,7 +2096,7 @@ If you want to use ``{{ MEDIA_URL }}`` in your templates, add
``'django.template.context_processors.media'`` in the ``'context_processors'`` ``'django.template.context_processors.media'`` in the ``'context_processors'``
option of :setting:`TEMPLATES`. option of :setting:`TEMPLATES`.
Example: ``"http://media.example.com/"`` Example: ``"https://media.example.com/"``
.. warning:: .. warning::
@ -3478,7 +3478,7 @@ Default: ``None``
URL to use when referring to static files located in :setting:`STATIC_ROOT`. URL to use when referring to static files located in :setting:`STATIC_ROOT`.
Example: ``"static/"`` or ``"http://static.example.com/"`` Example: ``"static/"`` or ``"https://static.example.com/"``
If not ``None``, this will be used as the base path for If not ``None``, this will be used as the base path for
:ref:`asset definitions<form-asset-paths>` (the ``Media`` class) and the :ref:`asset definitions<form-asset-paths>` (the ``Media`` class) and the

View File

@ -306,13 +306,13 @@ Sample usage:
>>> from django.utils import feedgenerator >>> from django.utils import feedgenerator
>>> feed = feedgenerator.Rss201rev2Feed( >>> feed = feedgenerator.Rss201rev2Feed(
... title="Poynter E-Media Tidbits", ... title="Poynter E-Media Tidbits",
... link="http://www.poynter.org/column.asp?id=31", ... link="https://www.poynter.org/tag/e-media-tidbits/",
... description="A group blog by the sharpest minds in online media/journalism/publishing.", ... description="A group blog by the sharpest minds in online media/journalism/publishing.",
... language="en", ... language="en",
... ) ... )
>>> feed.add_item( >>> feed.add_item(
... title="Hello", ... title="Hello",
... link="http://www.holovaty.com/test/", ... link="https://www.holovaty.com/test/",
... description="Testing.", ... description="Testing.",
... ) ... )
>>> with open("test.rss", "w") as fp: >>> with open("test.rss", "w") as fp:

View File

@ -49,7 +49,7 @@ the details of the attached photo:
>>> car.photo.path >>> car.photo.path
'/media/cars/chevy.jpg' '/media/cars/chevy.jpg'
>>> car.photo.url >>> car.photo.url
'http://media.example.com/cars/chevy.jpg' 'https://media.example.com/cars/chevy.jpg'
This object -- ``car.photo`` in the example -- is a ``File`` object, which means This object -- ``car.photo`` in the example -- is a ``File`` object, which means
it has all the methods and attributes described below. it has all the methods and attributes described below.

View File

@ -74,9 +74,9 @@ can be retrieved through this property:
>>> w = CalendarWidget() >>> w = CalendarWidget()
>>> print(w.media) >>> print(w.media)
<link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script> <script src="https://static.example.com/animations.js"></script>
<script src="http://static.example.com/actions.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. 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 .. code-block:: html+django
<link href="http://static.example.com/pretty.css" media="screen" rel="stylesheet"> <link href="https://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="https://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/newspaper.css" media="print" rel="stylesheet">
``js`` ``js``
------ ------
@ -153,11 +153,11 @@ example above:
>>> w = FancyCalendarWidget() >>> w = FancyCalendarWidget()
>>> print(w.media) >>> print(w.media)
<link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet">
<link href="http://static.example.com/fancy.css" media="all" rel="stylesheet"> <link href="https://static.example.com/fancy.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script> <script src="https://static.example.com/animations.js"></script>
<script src="http://static.example.com/actions.js"></script> <script src="https://static.example.com/actions.js"></script>
<script src="http://static.example.com/whizbang.js"></script> <script src="https://static.example.com/whizbang.js"></script>
The FancyCalendar widget inherits all the assets from its parent The FancyCalendar widget inherits all the assets from its parent
widget. If you don't want ``Media`` to be inherited in this way, add 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() >>> w = FancyCalendarWidget()
>>> print(w.media) >>> print(w.media)
<link href="http://static.example.com/fancy.css" media="all" rel="stylesheet"> <link href="https://static.example.com/fancy.css" media="all" rel="stylesheet">
<script src="http://static.example.com/whizbang.js"></script> <script src="https://static.example.com/whizbang.js"></script>
If you require even more control over inheritance, define your assets using a If you require even more control over inheritance, define your assets using a
:ref:`dynamic property <dynamic-property>`. Dynamic properties give you :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 To find the appropriate prefix to use, Django will check if the
:setting:`STATIC_URL` setting is not ``None`` and automatically fall back :setting:`STATIC_URL` setting is not ``None`` and automatically fall back
to using :setting:`MEDIA_URL`. For example, if the :setting:`MEDIA_URL` for 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``: was ``None``:
.. code-block:: pycon .. code-block:: pycon
@ -241,24 +241,24 @@ was ``None``:
... css = { ... css = {
... "all": ["/css/pretty.css"], ... "all": ["/css/pretty.css"],
... } ... }
... js = ["animations.js", "http://othersite.com/actions.js"] ... js = ["animations.js", "https://othersite.com/actions.js"]
... ...
>>> w = CalendarWidget() >>> w = CalendarWidget()
>>> print(w.media) >>> print(w.media)
<link href="/css/pretty.css" media="all" rel="stylesheet"> <link href="/css/pretty.css" media="all" rel="stylesheet">
<script src="http://uploads.example.com/animations.js"></script> <script src="https://uploads.example.com/animations.js"></script>
<script src="http://othersite.com/actions.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 .. code-block:: pycon
>>> w = CalendarWidget() >>> w = CalendarWidget()
>>> print(w.media) >>> print(w.media)
<link href="/css/pretty.css" media="all" rel="stylesheet"> <link href="/css/pretty.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script> <script src="https://static.example.com/animations.js"></script>
<script src="http://othersite.com/actions.js"></script> <script src="https://othersite.com/actions.js"></script>
Or if :mod:`~django.contrib.staticfiles` is configured using the Or if :mod:`~django.contrib.staticfiles` is configured using the
:class:`~django.contrib.staticfiles.storage.ManifestStaticFilesStorage`: :class:`~django.contrib.staticfiles.storage.ManifestStaticFilesStorage`:
@ -269,7 +269,7 @@ Or if :mod:`~django.contrib.staticfiles` is configured using the
>>> print(w.media) >>> print(w.media)
<link href="/css/pretty.css" media="all" rel="stylesheet"> <link href="/css/pretty.css" media="all" rel="stylesheet">
<script src="https://static.example.com/animations.27e20196a850.js"></script> <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 Paths as objects
---------------- ----------------
@ -316,12 +316,12 @@ operator to filter out a medium of interest. For example:
>>> w = CalendarWidget() >>> w = CalendarWidget()
>>> print(w.media) >>> print(w.media)
<link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script> <script src="https://static.example.com/animations.js"></script>
<script src="http://static.example.com/actions.js"></script> <script src="https://static.example.com/actions.js"></script>
>>> print(w.media["css"]) >>> 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 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. new ``Media`` object -- but one that only contains the media of interest.
@ -352,10 +352,10 @@ specified by both:
>>> w1 = CalendarWidget() >>> w1 = CalendarWidget()
>>> w2 = OtherWidget() >>> w2 = OtherWidget()
>>> print(w1.media + w2.media) >>> print(w1.media + w2.media)
<link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script> <script src="https://static.example.com/animations.js"></script>
<script src="http://static.example.com/actions.js"></script> <script src="https://static.example.com/actions.js"></script>
<script src="http://static.example.com/whizbang.js"></script> <script src="https://static.example.com/whizbang.js"></script>
.. _form-media-asset-order: .. _form-media-asset-order:
@ -383,10 +383,10 @@ For example:
>>> w1 = CalendarWidget() >>> w1 = CalendarWidget()
>>> w2 = TimeWidget() >>> w2 = TimeWidget()
>>> print(w1.media + w2.media) >>> print(w1.media + w2.media)
<script src="http://static.example.com/jQuery.js"></script> <script src="https://static.example.com/jQuery.js"></script>
<script src="http://static.example.com/calendar.js"></script> <script src="https://static.example.com/calendar.js"></script>
<script src="http://static.example.com/time.js"></script> <script src="https://static.example.com/time.js"></script>
<script src="http://static.example.com/noConflict.js"></script> <script src="https://static.example.com/noConflict.js"></script>
Combining ``Media`` objects with assets in a conflicting order results in a Combining ``Media`` objects with assets in a conflicting order results in a
``MediaOrderConflictWarning``. ``MediaOrderConflictWarning``.
@ -415,10 +415,10 @@ are part of the form:
>>> f = ContactForm() >>> f = ContactForm()
>>> f.media >>> f.media
<link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script> <script src="https://static.example.com/animations.js"></script>
<script src="http://static.example.com/actions.js"></script> <script src="https://static.example.com/actions.js"></script>
<script src="http://static.example.com/whizbang.js"></script> <script src="https://static.example.com/whizbang.js"></script>
If you want to associate additional assets with a form -- for example, If you want to associate additional assets with a form -- for example,
CSS for form layout -- add a ``Media`` declaration to the form: 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 = ContactForm()
>>> f.media >>> f.media
<link href="http://static.example.com/pretty.css" media="all" rel="stylesheet"> <link href="https://static.example.com/pretty.css" media="all" rel="stylesheet">
<link href="http://static.example.com/layout.css" media="all" rel="stylesheet"> <link href="https://static.example.com/layout.css" media="all" rel="stylesheet">
<script src="http://static.example.com/animations.js"></script> <script src="https://static.example.com/animations.js"></script>
<script src="http://static.example.com/actions.js"></script> <script src="https://static.example.com/actions.js"></script>
<script src="http://static.example.com/whizbang.js"></script> <script src="https://static.example.com/whizbang.js"></script>

View File

@ -75,7 +75,7 @@ These can't report on the internals of your code, but can provide a useful
insight into your site's overall performance, including aspects that can't be insight into your site's overall performance, including aspects that can't be
adequately measured from within Django environment. Examples include: adequately measured from within Django environment. Examples include:
* `Yahoo's Yslow <http://yslow.org/>`_ * `Yahoo's Yslow <https://yslow.org/>`_
* `Google PageSpeed <https://developers.google.com/speed/>`_ * `Google PageSpeed <https://developers.google.com/speed/>`_
There are also several paid-for services that perform a similar analysis, There are also several paid-for services that perform a similar analysis,