<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def conflict(request, target=None, template_name='409.html'):
 """409 error handler. :param request: Request :param template_name: `409.html` :param target: The model to save """

    try:
        template = loader.get_template(template_name)
    except TemplateDoesNotExist:  # pragma: no cover
        template = Template(
            '<h1>Conflict</h1>'
            '<p>The request was unsuccessful due to a conflict. '
            'The object changed during the transaction.</p>')
    try:
        saved = target.__class__._default_manager.get(pk=target.pk)
    except target.__class__.DoesNotExist:  # pragma: no cover
        saved = None
    ctx = {'target': target,
           'saved': saved,
           'request_path': request.path}

    return ConflictResponse(template.render(ctx))