Welcome to django-emailviews’s documentation!¶
Indices and tables¶
-
class
emailviews.views.
SendEmailMixin
[source]¶ Base mixin for sending emails. Uses django.core.mail.send_email to send the email. By default, to construct an email we will use django.template.loader.render_to_string passing
email_subject_template
andemail_body_template
as paths to the templates.
-
class
emailviews.views.
ActivationEmailViewMixin
[source]¶ Provides methods for generating and validating activation_keys. Uses django.core.signing.TimestampSigner allowing activation keys to expire after certain period of time.
You have to implement 2 methods while subclassing this view:
emailviews.views.ActivationEmailViewMixin.get_salt
emailviews.views.ActivationEmailViewMixin.get_max_age
-
generate_activation_key
(value: str) → str[source]¶ Generates activation key via django.core.signing.dumps.
-
get_request_root_url
()[source]¶ Generates root url of your website based on request. Example that you can use in your template:
{{root_url}}{% url 'activation' activation_key=activation_key %}
-
validate_activation_key
(key: str) → str[source]¶ Validates key using django.core.signing.loads If value is not validated (either time expires, or key is wrong) returns
None
.
-