1
0
mirror of https://github.com/django/django.git synced 2025-06-05 03:29:12 +00:00

[5.1.x] Added missing lang attributes to html elements in docs.

Backport of 97a6a678c406b0049bd17bcd34f1d71d96141994 from main.
This commit is contained in:
Johanan-Ayadata 2024-10-22 22:20:55 +00:00 committed by Sarah Boyce
parent ffc67aac1e
commit 5045dab4f9
3 changed files with 4 additions and 4 deletions

View File

@ -309,7 +309,7 @@ Here's what the "base.html" template, including the use of :doc:`static files
:caption: ``templates/base.html`` :caption: ``templates/base.html``
{% load static %} {% load static %}
<html> <html lang="en">
<head> <head>
<title>{% block title %}{% endblock %}</title> <title>{% block title %}{% endblock %}</title>
</head> </head>

View File

@ -256,7 +256,7 @@ Here's a sample :file:`flatpages/default.html` template:
.. code-block:: html+django .. code-block:: html+django
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en">
<head> <head>
<title>{{ flatpage.title }}</title> <title>{{ flatpage.title }}</title>
</head> </head>

View File

@ -23,7 +23,7 @@ Here's a view that returns the current date and time, as an HTML document::
def current_datetime(request): def current_datetime(request):
now = datetime.datetime.now() now = datetime.datetime.now()
html = "<html><body>It is now %s.</body></html>" % now html = '<html lang="en"><body>It is now %s.</body></html>' % now
return HttpResponse(html) return HttpResponse(html)
Let's step through this code one line at a time: Let's step through this code one line at a time:
@ -225,7 +225,7 @@ Here's an example of an async view::
async def current_datetime(request): async def current_datetime(request):
now = datetime.datetime.now() now = datetime.datetime.now()
html = "<html><body>It is now %s.</body></html>" % now html = '<html lang="en"><body>It is now %s.</body></html>' % now
return HttpResponse(html) return HttpResponse(html)
You can read more about Django's async support, and how to best use async You can read more about Django's async support, and how to best use async