how to pass account information to django template in django-registration? -
i want pass account information
template
when user account
activated, there message saying "your account activated; please log in now" link below. if activation days
have expired, must "activation days expired". have url , template here, not know how pass account information template.
url.py
urlpatterns = patterns('', url(r'^activate/complete/$', templateview.as_view(template_name='registration/activate.html'), name='registration_activation_complete'), ......)
registration/activate.html
{% extends "registration/base.html" %} {% block title %}account activated{% endblock %} {% block content %} <h1>account activated.</h1> {% load humanize %} {% if account %} <p>thanks signing up! can <a href="/accounts/login/">log in</a>.</p> {% else %} <p>sorry, didn't work. either activation link incorrect, or activation key account has expired; activation keys valid {{ expiration_days|apnumber }} days after registration.</p> {% endif %} {% endblock %}
basically, want pass account
, expiration_days
above template. don't know how. plz!
i'm afraid won't enough use templateview
did; you'll have write custom view contain logic activation , pass data template.
Comments
Post a Comment