I am aware there are already a lot of other answered questions about this. After reading them, I came up with the following code, so that I can style my email input field in my user registration form and in my login form. Focus is on the "widget=forms.EmailField(attrs={'id': 'rmkinput'})", which, as far as I understand from the readings, should give me css accessibility:
class UserRegForm(UserCreationForm) :
email = forms.EmailField(widget=forms.EmailField(attrs={'id': 'inputfield'}), label='eMail Adresse')
Nevertheless, when I "manage.py runserver", I get an error message:
super().__init__(strip=True, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\django\forms\fields.py", line 214, in __init__
super().__init__(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'attrs'
I kept reading the documentation and the other stakcoverflow questions, but I just can't figure it out. Can anybody help?
If more code is required to answer the question, let me know. Thanks!