Sie sind auf Seite 1von 14

 'django.contrib.

admin’ should be add in


INSTALLED_APPS
 Determinine which of your MODEL should be in
your admin interface
 ModelAdmin objects
 The register decorator
 @admin.register(<Model>)
 @admin.register(<mode1>, <model2>,
..site=custome_model>
 Model Admin Options:
 ModelAdmin.actions/ModelAdmin.adtion_on_top/ModelAdmi
n.action_on_bottom
 date_hierarchy ( date_hierarchy=‘<field name>’ )
 empty_value_display (empty_value_display =‘string name’ )
 exclude
 Fields / fieldsets
 Classes
 filter_horizontal/ filter_vertical
 A python callable view
 It takes the request object and respond
accordingly
 ROOT_URLCONF
 How Django processes a request
◦ django.conf.urls.url()
◦ Django runs through each URL pattern, in order, and stops
at the first one that matches the requested URL
◦ Once one of the regexes matches, Django imports and calls
the given view, which is a simple Python function (or
a class-based view). The view gets passed the following
arguments:
 An instance of HttpRequest.
 If the matched regular expression returned no named groups, then
the matches from the regular expression are provided as positional
arguments.
 The keyword arguments are made up of any named groups matched
by the regular expression, overridden by any arguments specified in
the optional kwargs argument to django.conf.urls.url().
 render(request, template_name, context=Non
e, content_type=None, status=None, using=
None)
 render_to_response(template_name, context
=None, content_type=None, status=None, us
ing=None)
 redirect(to, permanent=False, *args, **kwarg
s)
 HTTP Forms
◦ Form, action, method
 Form class
◦ Django.forms.Form
 Form templates
◦ {{ form }}
 Bound & UnBound form instances
 Rendering fields manually
 Form rendering options
◦ Form as table, form as <p>, form as ul
 Rendering form error messages
 Reusable form templtes.
◦ Include “form.html”
 Formsets

Das könnte Ihnen auch gefallen