djangodocs.org

1305 sections across all versions Narrow to Django 6.0 (current) →

Select

Reference Widgets Built-in widgetsSelector and checkbox widgets

classSelect[source] : - template_name: 'django/forms/widgets/select.html' - option_template_name: 'django/forms/widgets/select_option.html' - Renders as: <select><option ...>...</select>

4.2 5.0 5.1 5.2 6.0

BigIntegerField

Reference Model field reference Field types

classBigIntegerField(**options)[source] A 64-bit integer, much like an IntegerField except that it is guaranteed to fit numbers from -9223372036854775808 to 9223372036854775807. The default form widget for this field is a NumberInput.

4.2 5.0 5.1 5.2 6.0

TimeField

Reference Model field reference Field types

classTimeField(auto_now=False,auto_now_add=False,**options)[source] A time, represented in Python by a datetime.time instance. Accepts the same auto-population options as DateField. The default form widget for this field is a TimeInput. The admin adds some JavaScript shortcuts.

4.2 5.0 5.1 5.2 6.0

Arguments

Reference Model field reference Relationship fieldsManyToManyField

ForeignKey.related_name : The name to use for the relation from the related object back to this one. It’s also the default value for related_query_name (the name to use for the reverse filter name from the target model).

5.2 6.0

STATIC_URL

Reference Settings Static Files

Default: None URL to use when referring to static files located in STATIC_ROOT. Example: "static/" or "https://static.example.com/" If not None, this will be used as the base path for asset definitions (the Media class) and the staticfiles app.

4.2 5.0 5.1 5.2 6.0

Reference

Standard HttpResponse objects are static structures. They are provided with a block of pre-rendered content at time of construction, and while that content can be modified, it isn’t in a form that makes it easy to perform modifications.

4.2 5.0 5.1 5.2 6.0

Formsets

Topic guide

classBaseFormSet[source] A formset is a layer of abstraction to work with multiple forms on the same page. It can be best compared to a data grid.

4.2 5.0 5.1 5.2 6.0

Topic guide Formsets

Formsets have the following attributes and methods associated with rendering: BaseFormSet.renderer : Specifies the renderer to use for the formset. Defaults to the renderer specified by the FORM_RENDERER setting.

4.2 5.0 5.1 5.2 6.0

Topic guide Formsets Using a formset in views and templates

If you manually render fields in the template, you can render can_delete parameter with {{ form.DELETE }}: Similarly, if the formset has the ability to order (can_order=True), it is possible to render it with {{ form.ORDER }}.

4.2 5.0 5.1 5.2 6.0

Compiling message files

Topic guide Translation Localization: how to create language files

After you create your message file – and each time you make changes to it – you’ll need to compile it into a more efficient form, for use by gettext. Do this with the django-admin compilemessages utility.

4.2 5.0 5.1 5.2 6.0

Clickjacking protection

Topic guide Security in Django

Clickjacking is a type of attack where a malicious site wraps another site in a frame. This attack can result in an unsuspecting user being tricked into performing unintended actions on the target site.

4.2 5.0 5.1 5.2 6.0