code: def create_object(
          request, model=None, template_name=None,
          template_loader=loader, extra_context=None, post_save_redirect=None,
          login_required=False, context_processors=None, form_class=None):
      
      if extra_context is None:
          extra_context = {}
      if login_required and not request.user.is_authenticated:
          return redirect_to_login(request.path)
  
      model, form_class = get_model_and_form_class(model, form_class)
      if request.method == 'POST':
          form = form_class(request.POST, request.FILES)
          if form.is_valid():
              new_object = form.save()
  
              msg = ugettext("The %(verbose_name)s was created successfully.") %\
                  {"verbose_name": model._meta.verbose_name}
              messages.success(request, msg, fail_silently=True)
              return redirect(post_save_redirect, new_object)
      else:
          form = form_class()
  
      # Create the template, context, response
      if not template_name:
          template_name = "%s/%s_form.html" % (
              model._meta.app_label, model._meta.object_name.lower())
      t = template_loader.get_template(template_name)
      c = {
          'form': form,
      }
      apply_extra_context(extra_context, c)
      return HttpResponse(t.render(context=c, request=request))
docs: Generic object-creation function.
  
      Templates: ``<app_label>/<model_name>_form.html``
      Context:
          form
              the form for the object