0

allauth.account comes with a signup.html

{% extends "account/base.html" %}

{% load i18n %}

{% block head_title %}{% trans "Signup" %}{% endblock %}

{% block content %}
<h1>{% trans "Sign Up" %}</h1>

<p>{% blocktrans %}Already have an account? Then please <a href="{{ login_url }}">sign in</a>.{% endblocktrans %}</p>

<form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">
  {% csrf_token %}
  {{ form.as_p }}

  {% if redirect_field_value %}
      <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
  {% endif %}

  <button type="submit">{% trans "Sign Up" %} &raquo;</button>
</form>

{% endblock %}

i would like to override it instead of using the form

what do i need to post to the url account_signup?

thank you

ealeon
  • 12,074
  • 24
  • 92
  • 173

2 Answers2

0

The 'account_signup' url is aimed to receive the POST request passing at least the form fields marked as required in order to create an account. But keep in mind that the name of the fields may vary based on the allauth settings.

0

I ended up doing the same thing, ealeon. Here is what I went with and it works well. Pardon the bootstrap classes, but you get the gist.

<form class="login" method="POST" action="{% url 'account_login' %}">
    {% csrf_token %}
    {{ form.non_field_errors }}
    <div class="fieldWrapper">
        {{ form.login.errors }}
        {{ form.login }}
    </div>
    <div class="fieldWrapper">
        {{ form.password.errors }}
        {{ form.password }}
    </div>
    <div class="login-options pull-left">
        {{ form.remember.errors }}
        <label for="{{ form.remember.id_for_label }}">Stay signed in?</label>
        {{ form.remember }}
    </div>
    <div class="login-options pull-right">
      <a class="button secondaryAction"
         href="{% url 'account_reset_password' %}">
         {% trans "Forgot Password?" %}
      </a>
    </div>
    <button class="btn btn-block btn-primary" type="submit">{% trans "Sign In" %}</button>
    {% if redirect_field_value %}
    <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
    {% endif %}
</form>
kmctown
  • 11
  • 1
  • 2