Customize the layout of authentication forms

I have included the build in authentication views like this:

path("accounts/", include("django.contrib.auth.urls")),

I would like to customize the look & feel of the forms. To do so I added a registration/login.html, registration/password_reset_form.html, … to my template folder. This works fine so far.

What I’m missing is the information about the forms expected by the urls, where to post them, … I figured out that I can use {{ form }} in the template, but that’s just the “body” of the form. I did not found anything in the docs and Google did not help either. As I expect this to be a common use case I’m probably missing something obvious and would appreciate any hint.

The docs concerning what you can customize for those views is in the section Using the views

It might help if you were a little more specific and perhaps provide more details about exactly what it is you’re trying to do here? Changing the form isn’t going to do a whole lot of good without changing the view and defining how the view is going to use that modified form.

If you’re using the standard views, then you’ll probably want to use the standard forms.

1 Like

My goal was not to change the form fields, but just the look & feel of the pages. Basically I was just looking for the files in django/contrib/admin/templates/registration as starting points. For whatever reason I failed to find them yesterday, but now I obviously got them. Sorry for the confusion.