1
に行きます要求されたビューは、次のとおりです。は、私は私のジャンゴプロジェクトでの単純なAHREFリンクを持っている無限ループ
def some_view(request,some_id):
schObj = SomeModel.objects.get(id = some_id)
user = schObj.user
usermail = user.email
name = user.fname + " " + user.lname
template = get_template('../templates/email_templates/success_mail.html')
c = Context({})
c.update({'some_id':some_id,'address':user.address})
c.update({"fullname":name})
html = template.render(c)
subject = "Successfull."
email = EmailMessage(subject, html, to=[usermail],from_email='[email protected]')
email.content_subtype = "html"
email.send()
return HttpResponseRedirect(request.path)
私の問題は、ボタンをクリックした後、電子メールが繰り返しuser.And番目に送らなっている、あります無限ループに入ります。この問題を解決する方法は?
以外の何か他のものに変更します。ありがとう:) –
なぜダウン投票? –
まず、別のURLでHttpResponseRedirectを試しましたが、前のページにリダイレクトした後に間違った結果が出ました。 –