core.checks.Debug

class Debug(msg, hint=None, obj=None, id=None) [source]

core.validators.EmailValidator.whitelist

whitelist Whitelist of email domains to allow. By default, a regular expression (the domain_regex attribute) is used to validate whatever appears after the @ sign. However, if that string appears in the whitelist, this validation is bypassed. If not provided, the default whitelist is ['localhost']. Other domains that don’t contain a dot won’t pass validation, so you’d need to whitelist them as necessary.

utils.http.urlsafe_base64_encode()

urlsafe_base64_encode(s) [source] Encodes a bytestring in base64 for use in URLs, stripping any trailing equal signs.

auth.models.Permission.content_type

content_type Required. A reference to the django_content_type database table, which contains a record for each installed model.

Generic views

See Built-in class-based views API.

auth.models.PermissionsMixin.get_all_permissions()

get_all_permissions(obj=None) Returns a set of permission strings that the user has, both through group and user permissions. If obj is passed in, only returns the permissions for this specific object.

auth.middleware.AuthenticationMiddleware

class AuthenticationMiddleware Adds the user attribute, representing the currently-logged-in user, to every incoming HttpRequest object. See Authentication in Web requests.

core.files.storage._save()

_save(name, content) Called by Storage.save(). The name will already have gone through get_valid_name() and get_available_name(), and the content will be a File object itself. Should return the actual name of name of the file saved (usually the name passed in, but if the storage needs to change the file name return the new name instead).

postgres.operations.TrigramExtension

class TrigramExtension [source] New in Django 1.10. Installs the pg_trgm extension.

core.management.call_command()

django.core.management.call_command(name, *args, **options) To call a management command from code use call_command.