forms.Form.as_ul()

Form.as_ul() as_ul() renders the form as a series of <li> tags, with each <li> containing one field. It does not include the <ul> or </ul>, so that you can specify any HTML attributes on the <ul> for flexibility: >>> f = ContactForm() >>> f.as_ul() '<li><label for="id_subject">Subject:</label> <input id="id_subject" type="text" name="subject" maxlength="100" required /></li>\n<li><label for="id_message">

apps.AppConfig.get_model()

AppConfig.get_model(model_name) [source] Returns the Model with the given model_name. Raises LookupError if no such model exists in this application. model_name is case-insensitive.

Tablespaces

A common paradigm for optimizing performance in database systems is the use of tablespaces to organize disk layout. Warning Django does not create the tablespaces for you. Please refer to your database engine’s documentation for details on creating and managing tablespaces. Declaring tablespaces for tables A tablespace can be specified for the table generated by a model by supplying the db_tablespace option inside the model’s class Meta. This option also affects tables automatically created f

forms.DateTimeField

class DateTimeField(**kwargs) [source] Default widget: DateTimeInput Empty value: None Normalizes to: A Python datetime.datetime object. Validates that the given value is either a datetime.datetime, datetime.date or string formatted in a particular datetime format. Error message keys: required, invalid Takes one optional argument: input_formats A list of formats used to attempt to convert a string to a valid datetime.datetime object. If no input_formats argument is provided, the d

http.HttpRequest.site

HttpRequest.site From the CurrentSiteMiddleware: An instance of Site or RequestSite as returned by get_current_site() representing the current site.

views.generic.base.ContextMixin.get_context_data()

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 View instance. Use alters_data where appropriate Note th

auth.mixins.AccessMixin.handle_no_permission()

handle_no_permission() Depending on the value of raise_exception, the method either raises a PermissionDenied exception or redirects the user to the login_url, optionally including the redirect_field_name if it is set.

views.generic.dates.BaseDateListView.get_dated_items()

get_dated_items() [source] Returns a 3-tuple containing (date_list, object_list, extra_context). date_list is the list of dates for which data is available. object_list is the list of objects. extra_context is a dictionary of context data that will be added to any context data provided by the MultipleObjectMixin.

http.HttpResponse.reason_phrase

HttpResponse.reason_phrase The HTTP reason phrase for the response. Changed in Django 1.9: reason_phrase no longer defaults to all capital letters. It now uses the HTTP standard’s default reason phrases. Unless explicitly set, reason_phrase is determined by the current value of status_code.

views.generic.list.MultipleObjectMixin.page_kwarg

page_kwarg A string specifying the name to use for the page parameter. The view will expect this parameter to be available either as a query string parameter (via request.GET) or as a kwarg variable specified in the URLconf. Defaults to page.