Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you take a look at the sources for <a href="http://code.djangoproject.com/browser/django/trunk/django/contrib/auth/views.py" rel="noreferrer">django.contrib.auth.views.password_reset</a> you'll see that it uses <a href="http://code.djangoproject.com/browser/django/trunk/django/template/__init__.py" rel="noreferrer"><code>RequestContext</code></a>. The upshot is, you can use Context Processors to modify the context which may allow you to inject the information that you need.</p> <p>The b-list has a good <a href="http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/" rel="noreferrer">introduction to context processors</a>.</p> <p>Edit (I seem to have been confused about what the actual question was):</p> <p>You'll notice that <code>password_reset</code> takes a named parameter called <code>template_name</code>:</p> <pre><code>def password_reset(request, is_admin_site=False, template_name='registration/password_reset_form.html', email_template_name='registration/password_reset_email.html', password_reset_form=PasswordResetForm, token_generator=default_token_generator, post_reset_redirect=None): </code></pre> <p>Check <a href="https://docs.djangoproject.com/en/1.9/topics/auth/default/#django.contrib.auth.views.password_reset" rel="noreferrer">password_reset</a> for more information.</p> <p>... thus, with a urls.py like:</p> <pre><code>from django.conf.urls.defaults import * from django.contrib.auth.views import password_reset urlpatterns = patterns('', (r'^/accounts/password/reset/$', password_reset, {'template_name': 'my_templates/password_reset.html'}), ... ) </code></pre> <p><code>django.contrib.auth.views.password_reset</code> will be called for URLs matching <code>'/accounts/password/reset'</code> with the keyword argument <code>template_name = 'my_templates/password_reset.html'</code>.</p> <p>Otherwise, you don't need to provide any context as the <code>password_reset</code> view takes care of itself. If you want to see what context you have available, you can trigger a <code>TemplateSyntax</code> error and look through the stack trace find the frame with a local variable named <code>context</code>. If you want to modify the context then what I said above about context processors is probably the way to go.</p> <p>In summary: what do you need to do to use your own template? Provide a <code>template_name</code> keyword argument to the view when it is called. You can supply keyword arguments to views by including a dictionary as the third member of a URL pattern tuple.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload