views.generic.detail.SingleObjectTemplateResponseMixin.get_template_names()

get_template_names() Returns a list of candidate template names. Returns the following list: the value of template_name on the view (if provided) the contents of the template_name_field field on the object instance that the view is operating upon (if available) <app_label>/<model_name><template_name_suffix>.html

utils.timezone.deactivate()

deactivate() [source] Unsets the current time zone.

forms.CharField

class CharField(**kwargs) [source] Default widget: TextInput Empty value: '' (an empty string) Normalizes to: A Unicode object. Validates max_length or min_length, if they are provided. Otherwise, all inputs are valid. Error message keys: required, max_length, min_length Has three optional arguments for validation: max_length min_length If provided, these arguments ensure that the string is at most or at least the given length. strip New in Django 1.9. If True (default), t

utils.timezone.get_fixed_timezone()

get_fixed_timezone(offset) [source] Returns a tzinfo instance that represents a time zone with a fixed offset from UTC. offset is a datetime.timedelta or an integer number of minutes. Use positive values for time zones east of UTC and negative values for west of UTC.

admin.AdminSite.site_header

AdminSite.site_header The text to put at the top of each admin page, as an <h1> (a string). By default, this is “Django administration”.

forms.BoundField.css_classes()

BoundField.css_classes() [source] When you use Django’s rendering shortcuts, CSS classes are used to indicate required form fields or fields that contain errors. If you’re manually rendering a form, you can access these CSS classes using the css_classes method: >>> f = ContactForm(data={'message': ''}) >>> f['message'].css_classes() 'required' If you want to provide some additional classes in addition to the error and required classes that may be required, you can provide

forms.Form.errors

Form.errors Access the errors attribute to get a dictionary of error messages: >>> f.errors {'sender': ['Enter a valid email address.'], 'subject': ['This field is required.']} In this dictionary, the keys are the field names, and the values are lists of Unicode strings representing the error messages. The error messages are stored in lists because a field can have multiple error messages. You can access errors without having to call is_valid() first. The form’s data will be valida

forms.PasswordInput.render_value

render_value Determines whether the widget will have a value filled in when the form is re-displayed after a validation error (default is False).

auth.models.UserManager.create_user()

create_user(username, email=None, password=None, **extra_fields) Creates, saves and returns a User. The username and password are set as given. The domain portion of email is automatically converted to lowercase, and the returned User object will have is_active set to True. If no password is provided, set_unusable_password() will be called. The extra_fields keyword arguments are passed through to the User’s __init__ method to allow setting arbitrary fields on a custom User model. See Creatin

admin.ModelAdmin.message_user()

ModelAdmin.message_user(request, message, level=messages.INFO, extra_tags='', fail_silently=False) [source] Sends a message to the user using the django.contrib.messages backend. See the custom ModelAdmin example. Keyword arguments allow you to change the message level, add extra CSS tags, or fail silently if the contrib.messages framework is not installed. These keyword arguments match those for django.contrib.messages.add_message(), see that function’s documentation for more details. One d