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

forms.FileField

class FileField(**kwargs) [source] Default widget: ClearableFileInput Empty value: None Normalizes to: An UploadedFile object that wraps the file content and file name into a single object. Can validate that non-empty file data has been bound to the form. Error message keys: required, invalid, missing, empty, max_length Has two optional arguments for validation, max_length and allow_empty_file. If provided, these ensure that the file name is at most the given length, and that validation

core.files.uploadhandler.FileUploadHandler.handle_raw_input()

FileUploadHandler.handle_raw_input(input_data, META, content_length, boundary, encoding) [source] Allows the handler to completely override the parsing of the raw HTTP input. input_data is a file-like object that supports read()-ing. META is the same object as request.META. content_length is the length of the data in input_data. Don’t read more than content_length bytes from input_data. boundary is the MIME boundary for this request. encoding is the encoding of the request. Return None if yo

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

gis.geos.GEOSGeometry.geom_typeid

GEOSGeometry.geom_typeid Returns the GEOS geometry type identification number. The following table shows the value for each geometry type: Geometry ID Point 0 LineString 1 LinearRing 2 Polygon 3 MultiPoint 4 MultiLineString 5 MultiPolygon 6 GeometryCollection 7

template.response.SimpleTemplateResponse.resolve_context()

SimpleTemplateResponse.resolve_context(context) [source] Preprocesses context data that will be used for rendering a template. Accepts a dict of context data. By default, returns the same dict. Override this method in order to customize the context.

views.generic.base.ContextMixin

class django.views.generic.base.ContextMixin Methods get_context_data(**kwargs) Returns a dictionary representing the template context. The keyword arguments provided will make up the returned context. Example usage: def get_context_data(self, **kwargs): context = super(RandomNumberView, self).get_context_data(**kwargs) context['number'] = random.randrange(1, 100) return context The template context of all class-based generic views include a view variable that points to the V

core.validators.URLValidator

class URLValidator(schemes=None, regex=None, message=None, code=None) [source] A RegexValidator that ensures a value looks like a URL, and raises an error code of 'invalid' if it doesn’t. Loopback addresses and reserved IP spaces are considered valid. Literal IPv6 addresses (RFC 2732) and unicode domains are both supported. In addition to the optional arguments of its parent RegexValidator class, URLValidator accepts an extra optional attribute: schemes URL/URI scheme list to validate aga

template.Engine.select_template()

Engine.select_template(self, template_name_list) [source] Like get_template(), except it takes a list of names and returns the first template that was found.

admin.register()

register(*models, site=django.admin.sites.site) [source] There is also a decorator for registering your ModelAdmin classes: from django.contrib import admin from .models import Author @admin.register(Author) class AuthorAdmin(admin.ModelAdmin): pass It is given one or more model classes to register with the ModelAdmin and an optional keyword argument site if you are not using the default AdminSite: from django.contrib import admin from .models import Author, Reader, Editor from myproje