diff --git a/cookiecutter.json b/cookiecutter.json index fd5bd0f..4b483bc 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -3,6 +3,10 @@ "project_slug": "{{ cookiecutter.project_name.lower()|replace(' ', '_')|replace('-', '_')|replace('.', '_')|trim() }}", "python_version": "3.11.1", "_copy_without_render": [ - "*.html" + "*.html", + "*/activation*.txt" + ], + "_extensions": [ + "cookiecutter.extensions.RandomStringExtension" ] } diff --git a/{{cookiecutter.project_slug}}/src/common/forms.py b/{{cookiecutter.project_slug}}/src/common/forms.py new file mode 100644 index 0000000..b63633f --- /dev/null +++ b/{{cookiecutter.project_slug}}/src/common/forms.py @@ -0,0 +1,8 @@ +import django_registration.forms + +from common.models import User + + +class RegistrationForm(django_registration.forms.RegistrationForm): + class Meta(django_registration.forms.RegistrationForm.Meta): + model = User diff --git a/{{cookiecutter.project_slug}}/src/common/templates/django_registration/activation_complete.html b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/activation_complete.html new file mode 100644 index 0000000..8f609b1 --- /dev/null +++ b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/activation_complete.html @@ -0,0 +1,7 @@ +{% extends "common/base.html" %} + +{% block content %} +
Votre compte est désormais actif.
+ +{% endblock %} diff --git a/{{cookiecutter.project_slug}}/src/common/templates/django_registration/activation_email_body.txt b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/activation_email_body.txt new file mode 100644 index 0000000..e76e294 --- /dev/null +++ b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/activation_email_body.txt @@ -0,0 +1,2 @@ +Voici votre clé d'activation : https://{{ site.domain }}{% url "django_registration_activate" activation_key=activation_key %} +Elle est valable pendant {{ expiration_days }} jours. diff --git a/{{cookiecutter.project_slug}}/src/common/templates/django_registration/activation_email_subject.txt b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/activation_email_subject.txt new file mode 100644 index 0000000..ac61dee --- /dev/null +++ b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/activation_email_subject.txt @@ -0,0 +1 @@ +[{{cookiecutter.project_name}}] Activation de compte diff --git a/{{cookiecutter.project_slug}}/src/common/templates/django_registration/activation_failed.html b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/activation_failed.html new file mode 100644 index 0000000..8cdb98b --- /dev/null +++ b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/activation_failed.html @@ -0,0 +1,8 @@ +{% extends "common/base.html" %} + +{% block content %} ++ {{ activation_error }} +
+{% endblock %} diff --git a/{{cookiecutter.project_slug}}/src/common/templates/django_registration/registration_closed.html b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/registration_closed.html new file mode 100644 index 0000000..7a92514 --- /dev/null +++ b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/registration_closed.html @@ -0,0 +1,6 @@ +{% extends "common/base.html" %} + +{% block content %} +Les inscriptions sont désactivées.
+{% endblock %} diff --git a/{{cookiecutter.project_slug}}/src/common/templates/django_registration/registration_complete.html b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/registration_complete.html new file mode 100644 index 0000000..19209d9 --- /dev/null +++ b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/registration_complete.html @@ -0,0 +1,6 @@ +{% extends "common/base.html" %} + +{% block content %} +Un e-mail permettant d'activer votre compte vous a été envoyé.
+{% endblock %} diff --git a/{{cookiecutter.project_slug}}/src/common/templates/django_registration/registration_form.html b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/registration_form.html new file mode 100644 index 0000000..0422e19 --- /dev/null +++ b/{{cookiecutter.project_slug}}/src/common/templates/django_registration/registration_form.html @@ -0,0 +1,10 @@ +{% extends "common/base.html" %} + +{% block content %} +