Not working instance in the form?

Form saves the data but does not display them as instance, that is, if we want to edit something, the form is blank, and it is expected that there will be a placeholder, I do not understand why it works on another page, almost identical code

from .models import Config
from .forms import ConfigForm
from django.contrib.auth.decorators import login_required

@login_required
def settings(request):
 config = Config.objects.all().first()
 form = ConfigForm(request.POST, instance=config)
 if request.method == "POST":
 if form.is_valid():
 config_set = form.save()
 return redirect('/settings')
else:
 return render(request, 'settings.html', {'config': config, 'form': form})


So I bring the form field into the html (of course, all wrapped the rest of the forms, it works in the admin object is displayed, is not displayed the instance when I want to edit an object created in this form)
{{form.name}}

here is the form code
from django import forms
from .models import Config

class ConfigForm(forms.ModelForm):
 class Meta:

 model = Config
 fields = ('name')
March 23rd 20 at 19:32
0 answer

Find more questions by tags Django