...views.py

def add_comment(request, pk):
    """Add a new comment."""
    p = request.POST

    if p.has_key("body") and p["body"]:
        author = "Anonymous"
        if p["author"]: author = p["author"]
        comment = Comment(post=Post.objects.get(pk=pk))

        # save comment form
        cf = CommentForm(p, instance=comment)
        cf.fields["author"].required = False
        comment = cf.save(commit=False)

        # save comment instance
        comment.author = author
        notify = True
        if request.user.username == "ak": notify = False
        comment.save(notify=notify)
    return HttpResponseRedirect(reverse("dbe.blog.views.post",
args=[pk]))



On 7 Mag, 22:03, Aragorn <xilo...@gmail.com> wrote:
> Hello,
> I tried it runserver on the production server and does not work!
> I made some mistakes in copying the code?
>
> On 4 Mag, 15:30, Xavier Ordoquy <xordo...@linovia.com> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > Have you tried the development server (runserver) on the computer that runs 
> > the wsgy ?
> > What LANG does apache declares (/etc/apache/envvars) ?
> > How much of the body do you change in the save function ?
>
> > Xavier.
>
> > Le 4 mai 2011 à 15:16, Massimo a écrit :
>
> > > Yes, I get an email when someone writes a
> > > comment. (Sorry but I do not speak English). If I run with "python 
> > > manage.py runserver" the email arrives well, if run with apache wsgy  the 
> > > result is the error !
>
> > > 2011/5/4 Xavier Ordoquy <xordo...@linovia.com>
>
> > > Le 4 mai 2011 à 13:44, Aragorn a écrit :
>
> > > > HI,
>
> > > > I can not understand where is the error. when you insert a
> > > > blog comment I receive an email, but this'
> > > > the email I receive !
>
> > > Hi,
>
> > > I noticed you have overridden the save method. Could you tell us more 
> > > about what you are doing the that method ?
> > > I suspect you try to send a mail telling you you have a new comment, 
> > > don't you ?
>
> > > Regards,
> > > Xavier.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Django users" group.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > django-users+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/django-users?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Django users" group.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > django-users+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to