part of forms.py
class FormPublicar(forms.ModelForm):
class Meta:
model = Publicacao
exclude = ('usuario', 'aprovado', 'cadastrado_em', 'slug')
def enviar(self):
titulo = 'mensagem enviada pelo site'
destino = self.cleaned_data['emailp']
mensagem = u"""
Message that will be sent after completing the form.
Here I must pass a link to the full URL into the body of the email, something like:
[ 1 ]http://www.domain.com/item/playstation3/
/view/slug/
""" % self.cleaned_data
send_mail(
subject = titulo,
message = mensagem,
from_email = '[email protected]',
recipient_list =[destino],
)
[ 1 ] I read about the "reverse", tried to mount url + view + parameter. But I could not generate the link correctly, did a number of ways but could not.
I need to pass the domain name+view+parameter slug that is generated after completing the form.
For the recipient of e-mail see the correct link.
Can anyone help me? Thanks in advance.