I am facing similar error while I am rendering html template to PDF by 
using xhtml2pdf. Same when my template have small number of rows it works 
perfect to render as pdf but when my result fetch mutiple table rows it 
start processing and after couple of duration give error [Errno 104] 
Connection reset by peer. 

On Tuesday, June 28, 2016 at 7:56:04 PM UTC+5, Haomin Zhang wrote:
>
> Create a command like below, which send a mail to the user if the date 
> meet the requirement:
>
> class Command(BaseCommand):
>     help= 'Send mail to user regularly if there have contacts needs 
> reminder'
>     
>     def handle(self, *args, **options):
>         now = timezone.now().date()
>         backlogs = Backlog.objects.all()
>         for backlog in backlogs.iterator():
>             start_date = backlog.start_date
>             end_date = backlog.end_date
>             if start_date <= now and now < end_date:
>                 user = backlog.user
>                 user_email = user.email
>                 user_name = user.username
>                 if user_email is not None:
>                     mail_title = u'Contracts need to be handling.'
>                     mail_content = u"Dear:%s,you have messages" % user_name
>                     link = u"http://xx.xxx.xx.xxx/contract-info/";
>                     mail_content += link;
>                     mail_from = 'from_...@xx.com <javascript:>'
>                     mail_to = [user_email]
>                     send_mail(mail_title,
>                           mail_content,
>                           mail_from,
>                           mail_to)
>
> This command can run well in local server. But when I launch it on the VPS 
> and if call send_mail more than once, below mesasge appear:
>
> "SMTPServerDisconnected: Connection unexpectedly closed: [Errno 104] 
> Connection reset by peer"
>
> But if only one backlog been filtered and only call once send_mail, it 
> works well.
>
> Does anybody met the issue before? thanks in advance!
>
> -Haomin
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3096908c-c517-481c-8053-d5863b42c1dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to