Answer the question
In order to leave comments, you need to log in
How to add styling to a standard django registration form?
I found the layout of the registration form with the style, I want to add registration and authorization of users to the project.
I do this using a standard form: in the registration/login.html file I wrote a standard implementation without a style - { form } and everything worked (authorization), but I can’t figure out how to make this form stylized or adjust it to the layout of another form. Please tell me what to do with { form }, how to style it?
Answer the question
In order to leave comments, you need to log in
With django crispy forms and {% crispy form %}
Briefly, applies the styles from the bootstrap to both standard forms and custom forms.
upd. There is of course another option. You can look at the standard form class and find out exactly what fields it has. I think they are called username and password.
Further, when you insert a form into html, do not shove it with a whole object - {{ form }}
, but shove the fields separately according to the layout elements you need, referring to the fields - {{ form.username }}
and, accordingly {{ form.password }}
. Well and accordingly stylize each of the elements the way you want.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question