def METHOD_NAME(request, license_id):
    license = get_object_or_404(License, pk=license_id)
    if request.method == 'POST':
        form = LicenseForm(request.POST, instance=license)
        if form.is_valid():
            license = form.save()
            return redirect(license_index)
    else:
        form = LicenseForm(instance=license)
    context = {'form': form, 'license': license}
    return render(request, 'forms/edit_license.html', context)