Answer the question
In order to leave comments, you need to log in
How to add beauty to standard django forms?
Hello everyone, there is a class form.py
class AuthUserForm(AuthenticationForm, forms.ModelForm):
class Meta:
model = User
fields = ('username','password')
def __init__(self,*args,**kwargs):
super().__init__(*args,**kwargs)
for field in self.fields:
self.fields[field].widget.attrs['class'] = 'form-control'
<body>
<div class="col-4">
<form id="add_form" method="post">
{% csrf_token %}
{{form}}
<button form="add_form" type="submit" class="login-button">>Войти</button>
</form>
</div>
</body>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question