macropin/django-registration — pull request #9 by miki725 (2014-09-07 23:54:41+00:00)
Title: Passing request to send_activation_email

This fixes #8

Added an optional parameter `request` to `create_inactive_user`. If it is passed `send_activation_email` takes advantage of it by initializing `ContextRequest` which allows to reference all the extra variables added by template context processors.

----

The reason I actually needed this is to generate absolute URLs in the generated email. This allows me to do this:

http{% if request.is_secure %}s{% endif %}://{{ request.get_host }}{% url 'registration_activate' activation_key=activation_key %}

and once I will transition to Django 1.7 something like this is possible:

{{ request.scheme }}://{{ request.get_host }}{% url 'registration_activate' activation_key=activation_key %}