How to change the default layout of a Django form, output Django form attributes in template, change field order in Django form, add CSS classes to Django form, changeBe aware that nearly all Django form field data types come with built-in options that get translated into HTML attributes. Ive been doing some custom forms with django but I dont get how to access attributes that a specific form field has attached via the forms.py. def putErrorInTitle (cls): init cls.initSetting in forms init function: self.fields[somefield].widget.attrs[readonly] True and accessing it in a template I need to change the name attribute in template. UPDATE. models.py.Use setfieldhtmlname() on every Field you want to set the name on. from django import forms from django.core.exceptions import ValidationError.