How can I change the login and registration fields in django allauth?

How can I change the login and registration fields in django allauth, for example, instead of using the username and password to log in, I wanted to enter the email and password, or registration and password. Or even in the registration, put other fields that I can’t do this, from what I understand, authentication is a module in the source code of django all auth.

This is the code

{% element form form=form method="post" action=login_url tags="entrance,login" %}
        {% slot body %}
            {% csrf_token %}
            {% element fields form=form unlabeled=True %}
            {% endelement %}
            {% if redirect_field_value %}
                <input type="hidden"
                       name="{{ redirect_field_name }}"
                       value="{{ redirect_field_value }}" />
            {% endif %}
        {% endslot %}
        {% slot actions %}
            {% element button type="submit" tags="prominent,login" %}
                {% trans "Sign In" %}
            {% endelement %}
        {% endslot %}
    {% endelement %}

But i can’t change it as it is. Somebody can help me?

Welcome @ThomasNeder !

I can’t help you with your specific question, but there are a couple things I’d like to point out.

First, what you’ve posted is part of a template and is not “code”. It is text data that is converted by the rendering engine to HTML. The code associated with this would be in a .py file somewhere in the project.

More importantly here, when you’re posting code (or templates, or error messages) you’ll want to enclose that code (or template, etc) between lines of three backtick - ` characters. This means you’ll have a line of ```, then the code (etc), then another line of ```. This forces the forum software to keep that text properly formatted.
(I’ve taken the liberty of editing your original post for this. Please do this in the future.)

1 Like