From b991eefd3a9fa4da4eb46fddcb36cf1e8b5862e9 Mon Sep 17 00:00:00 2001 From: Alasdair Nicol Date: Tue, 5 Nov 2019 11:41:14 +0000 Subject: [PATCH] Refs #30923 -- Fixed an example of rendering templates in contrib.sites docs. --- docs/ref/contrib/sites.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/ref/contrib/sites.txt b/docs/ref/contrib/sites.txt index ee2ea15ef2..52e90cc899 100644 --- a/docs/ref/contrib/sites.txt +++ b/docs/ref/contrib/sites.txt @@ -218,14 +218,14 @@ different template directories (:setting:`DIRS `), you could farm out to the template system like so:: from django.core.mail import send_mail - from django.template import Context, loader + from django.template import loader def register_for_newsletter(request): # Check form values, etc., and subscribe the user. # ... - subject = loader.get_template('alerts/subject.txt').render(Context({})) - message = loader.get_template('alerts/message.txt').render(Context({})) + subject = loader.get_template('alerts/subject.txt').render({}) + message = loader.get_template('alerts/message.txt').render({}) send_mail(subject, message, 'editor@ljworld.com', [user.email]) # ...