In my view.py I have a variable - for example 'email'. In my forms.py I have an email field - for example:
email = forms.EmailField(label="Email adress")
I would like to change this to:
email = forms.EmailField(label="Email adress", widget=forms.TextInput(attrs={'readonly': 'readonly'}))
when email variable from my view.py is filled (from None to any value). By default email is set to None. How can I achieve that?