Writing your first Django app, part 4

This tutorial begins where Tutorial 3 left off. We’re continuing the Web-poll application and will focus on simple form processing and cutting down our code. Write a simple form Let’s update our poll detail template (“polls/detail.html”) from the last tutorial, so that the template contains an HTML <form> element: <h1>{{ question.question_text }}</h1> {% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} <form action="{% url

forms.BoundField.html_name

BoundField.html_name The name that will be used in the widget’s HTML name attribute. It takes the form prefix into account.

admin.ModelAdmin.get_list_select_related()

ModelAdmin.get_list_select_related(request) [source] New in Django 1.9. The get_list_select_related method is given the HttpRequest and should return a boolean or list as ModelAdmin.list_select_related does.

core.files.storage.DefaultStorage

class DefaultStorage [source] DefaultStorage provides lazy access to the current default storage system as defined by DEFAULT_FILE_STORAGE. DefaultStorage uses get_storage_class() internally.

utils.feedgenerator.SyndicationFeed.add_item_elements()

add_item_elements(handler, item) [source] Add elements on each item (i.e. item/entry) element.

apps.AppConfig

class AppConfig [source] Application configuration objects store metadata for an application. Some attributes can be configured in AppConfig subclasses. Others are set by Django and read-only.

auth.backends.RemoteUserBackend.user_can_authenticate()

RemoteUserBackend.user_can_authenticate() New in Django 1.10. Returns whether the user is allowed to authenticate. This method returns False for users with is_active=False. Custom user models that don’t have an is_active field are allowed.

views.generic.dates.DayMixin.get_day_format()

get_day_format() [source] Returns the strftime() format to use when parsing the day. Returns day_format by default.

views.generic.edit.FormMixin.get_context_data()

get_context_data(**kwargs) New in Django 1.9. Calls get_form() and adds the result to the context data with the name ‘form’.

views.generic.base.TemplateResponseMixin.template_engine

template_engine The NAME of a template engine to use for loading the template. template_engine is passed as the using keyword argument to response_class. Default is None, which tells Django to search for the template in all configured engines.