Reference Widgets Built-in widgetsSelector and checkbox widgets
classSelect : - template_name: 'django/forms/widgets/select.html' - option_template_name: 'django/forms/widgets/select_option.html' - Renders as: <select><option ...>...</select>
654 sections in Django 4.2 Search all versions →
Reference Widgets Built-in widgetsSelector and checkbox widgets
classSelect : - template_name: 'django/forms/widgets/select.html' - option_template_name: 'django/forms/widgets/select_option.html' - Renders as: <select><option ...>...</select>
Reference Model field reference Field types
classBigIntegerField(**options) 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.
Reference Model field reference Field types
classDateTimeField(auto_now=False,auto_now_add=False,**options) A date and time, represented in Python by a datetime.datetime instance. Takes the same extra arguments as DateField. The default form widget for this field is a single DateTimeInput. The admin uses two separate TextInput widgets with JavaScript shortcuts.
Reference Model field reference Field types
classGenericIPAddressField(protocol='both',unpack_ipv4=False,**options) An IPv4 or IPv6 address, in string format (e.g. 192.0.2.30 or 2a02:42fe::4). The default form widget for this field is a TextInput.
Reference Model field reference Field types
classTimeField(auto_now=False,auto_now_add=False,**options) 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.
Reference Request and response objects StreamingHttpResponse objects
HttpRequest.META : A dictionary containing all available HTTP headers.
Reference Settings Core Settings
New in Django 3.2.18. Default: 100 The maximum number of files that may be received via POST in a multipart/form-data encoded request before a SuspiciousOperation (TooManyFiles) is raised. You can set this to None to disable the check.
Reference Settings Static Files
Default: None URL to use when referring to static files located in STATIC_ROOT. Example: "static/" or "http://static.example.com/" If not None, this will be used as the base path for asset definitions (the Media class) and the staticfiles app.
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.
Topic guide Using the Django authentication system Authentication in web requestsAuthentication Views
classPasswordResetDoneView : URL name: password_reset_done classPasswordResetConfirmView : URL name: password_reset_confirm
Topic guide Using the Django authentication system Authentication in web requestsAuthentication Views
classPasswordResetCompleteView : URL name: password_reset_complete
Topic guide Using the Django authentication system Managing users in the admin
Included in the display of this information is a link to a password change form that allows admins to change user passwords.
Topic guide Introduction to class-based views
A basic function-based view that handles forms may look something like this: A similar class-based view might look like: This is a minimal case, but you can see that you would then have the option of customizing this view by …
Topic guide
classBaseFormSet 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.
Topic guide Formsets
In the rendered HTML, formsets include a prefix on each field’s name. By default, the prefix is 'form', but it can be customized using the formset’s prefix argument.
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.
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 }}.
Topic guide Formsets Using a formset in views and templates
You are able to use more than one formset in a view if you like. Formsets borrow much of its behavior from forms.
Topic guide Working with forms
Handling forms is a complex business.
Topic guide Working with forms
We’ve described HTML forms briefly, but an HTML <form> is just one part of the machinery required.