<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_bookmark(request):
 """ This view serves and validates a bookmark form. If requested via ajax it also returns the drop bookmark form to replace the add bookmark form. """

    if request.method == "POST":
        form = BookmarkForm(user=request.user, data=request.POST)
        if form.is_valid():
            bookmark = form.save()
            if not request.is_ajax():
                messages.success(request, 'Bookmark added')
                if request.POST.get('next'):
                    return HttpResponseRedirect(request.POST.get('next'))
                return HttpResponse('Added')
            return render_to_response(
                'admin_tools/menu/remove_bookmark_form.html',
                {'bookmark': bookmark, 'url': bookmark.url}
            )
    else:
        form = BookmarkForm(user=request.user)
    return render_to_response(
        'admin_tools/menu/form.html',
        {'form': form, 'title': 'Add Bookmark'}
    )