Trilla
Trilla

Reputation: 771

Django Allauth executes request.POST on signup, but no redirect or email sent?

This started happening yesterday (it was working fine before), I've retraced my steps and reversed any edits and it's still not working.

I'm using Allauth with Django and the generic signup form /accounts/signup/ isn't redirecting to verification_sent.html.

An email_confirm.html is also not being sent to confirm the account.

I've set up an email backend to test on localhost and normally the emails come through fine via the terminal window. Now when I submit the form and request.POST, nothing happens.

No emails, no verification_sent.html page redirection.

The terminal isn't throwing any errors and says

HTTP POST /accounts/signup/ 200

How can I go about debugging this?

signup.html

<form method="POST">
      {% csrf_token %}
    {{ form.email|as_crispy_field }}
    {{ form.first_name|as_crispy_field }}
    {{ form.last_name|as_crispy_field }}
    {{ form.password1|as_crispy_field }}
    {{ form.password2|as_crispy_field }}
    {{ form.captcha|as_crispy_field }}
    <button type="submit" value="submit" id='signup_button'>Sign Up</button>
</form>

forms.py

class UserRegisterForm(forms.Form):
    captcha = ReCaptchaField()
    email = forms.EmailField()
    first_name = forms.CharField(required=True)
    last_name = forms.CharField(required=True)

    def signup(self, request, user):
        user.first_name = self.cleaned_data['first_name']
        user.last_name = self.cleaned_data['last_name']
        user.save()

settings.py

ACCOUNT_SIGNUP_FORM_CLASS = 'users.forms.UserRegisterForm'

ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_UNIQUE_EMAIL = True
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
ACCOUNT_USERNAME_REQUIRED = False
ACCOUNT_AUTHENTICATION_METHOD = 'email'
ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS=7
ACCOUNT_LOGIN_ATTEMPTS_LIMIT = 5
ACCOUNT_LOGIN_ATTEMPTS_TIMEOUT = 86400 # 1 day in seconds

Upvotes: 3

Views: 414

Answers (1)

Trilla
Trilla

Reputation: 771

Fixed the problem by taking out the captcha for local testing as it was showing Localhost is not in the list of supported domains for this site key.

Upvotes: 0

Related Questions