Django Imagefield not saved

  django, django-forms, python

Although I select images in the form, image changes do not saved. Other inputs are saving. Help me pls.


<form method="POST" enctype="multipart/form-data">
                    {% csrf_token %}
<button type="submit">Save</button>

from django.db import models

class SiteSetting(models.Model):
    logo = models.ImageField(blank=True, verbose_name="Logo")

    def logo_url(self):
        if self.logo and hasattr(self.logo, 'url'):
            return self.logo.url

def SiteSettingsView(request):
    settings = SiteSetting.objects.all()
    settingform = SiteSettingForm(instance=settings[0])
    if request.method == 'POST':
        settingform = SiteSettingForm(request.POST, instance=settings[0])
        if settingform.is_valid():
            return redirect('home')
    context = {
        'settings': settings[0],
        'settingform': settingform
    return render(request, 'x.html', context)

from site_setting.models import SiteSetting

class SiteSettingForm(forms.ModelForm):
    class Meta:
        model = SiteSetting
        fields = '__all__'

Source: Python Questions