initial Argument: how to set the initial value for using the tag {{ item.index_title }}...?

show_title = forms.CharField(install={{ item.index_photo_title }}, required=True)

There is very little context here so I’ll try my best. The code that you’ve shared is not valid Python syntax. It looks like you’re trying to mix template syntax with a form class definition.

The forms documentation explains how to use initial values. I’d suggest reading that portion of the documentation.

1 Like

now it’s out of this


{% for item in list_photo_index %}

Oh, you should

if the code is two views app + forms
Form.get_initial_for_field(field, field_name) = но, как это использовать?