add signup success view

bracket-feature
Raz 9 months ago
parent b9cc725e32
commit c80246d032
  1. 16
      padelclub_backend/settings.py
  2. 22
      tournaments/templates/registration/signup_success.html
  3. 5
      tournaments/views.py

@ -142,15 +142,6 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
CSRF_TRUSTED_ORIGINS = [
'http://127.0.0.1:8000',
'https://padelclub.app',
'http://padelclub.app'
] # Ajoutez vos domaines de confiance
from .settings_local import *
from .settings_app import *
# settings.py # settings.py
LOGIN_REDIRECT_URL = '/' # Redirect to the homepage after login LOGIN_REDIRECT_URL = '/' # Redirect to the homepage after login
LOGOUT_REDIRECT_URL = '/' # Redirect to the homepage after logout LOGOUT_REDIRECT_URL = '/' # Redirect to the homepage after logout
@ -160,8 +151,5 @@ AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend', 'django.contrib.auth.backends.ModelBackend',
] ]
CSRF_COOKIE_SECURE = True # if using HTTPS from .settings_local import *
CSRF_COOKIE_HTTPONLY = False # needed for AJAX requests from .settings_app import *
CSRF_USE_SESSIONS = False # store CSRF token in cookie instead of session
CSRF_COOKIE_SAMESITE = 'Lax' # or 'Strict' for more security
LOGIN_URL = 'login'

@ -0,0 +1,22 @@
{% extends 'tournaments/base.html' %}
{% block head_title %} Création de compte {% endblock %}
{% block first_title %} Padel Club {% endblock %}
{% block second_title %} Création de compte {% endblock %}
{% block content %}
{% load static %}
{% load tz %}
<div class="grid-x">
<div class="bubble">
<label class="title">Votre compte a été créé</label>
<div class="cell medium-6 large-6 my-block">
Veuillez vérifier votre e-mail pour confirmer votre compte.
</div>
<div class="topmargin20">
<a href="{{ next_url }}" class="rounded-button">Continuer</a>
</div>
</div>
</div>
{% endblock %}

@ -634,8 +634,9 @@ def signup(request):
send_verification_email(request, user, next_url) send_verification_email(request, user, next_url)
messages.success(request, "Votre compte a été créé ! Veuillez vérifier votre e-mail pour confirmer votre compte.") return render(request, 'registration/signup_success.html', {
return redirect(next_url) 'next_url': next_url
})
else: else:
form = SimpleCustomUserCreationForm() form = SimpleCustomUserCreationForm()

Loading…
Cancel
Save