python – Default Values ​​in the Template – Django

I'm studying django and I'm trying to set a default value for a field, when makemigrations is executed, it informs that this field will receive a default value like 0

models.IntegerField (default = 0)

It happens that predefined is set to No

I do not understand, the documentation says everything I want.

models.IntegerField (default = 0)

The default value is also 0.

8 – Target individual elements of a multivalued field in my page template

There are many ways to do it. If you are using a custom theme or subtopic, you must follow the naming conventions of the Twig templates and create your own theme. field - knot - MYFIELDNAME.html.twig model. And then simply adjust the markup as needed.

See Classy field.html.twig for reference and its for loop, you can simply customize:

{% for the article in the articles%}
  
    {{}} Item.content
  
{% endfor%}

To target the second element of a multivalent field in the interior page.html.twig use the following excerpt (he starts counting with 0, so that 0 is the first and 1 is the second element).

{{}} Node.field_MYFIELD.1.value