Gunicor + Postgres + Python 3

100 views
Skip to first unread message

Henrique Oliveira

unread,
Mar 10, 2014, 12:14:18 AM3/10/14
to django...@googlegroups.com
Hi there,

I have set Django + gunicorn + python 3 in a production env, but I am gettin critical timeout on simple request(home).
Any Ideas?

14-03-09 23:11:21 [14029] [INFO] Listening at: http://127.0.0.1:8001 (14029)
2014-03-09 23:11:21 [14029] [INFO] Using worker: sync
2014-03-09 23:11:21 [14039] [INFO] Booting worker with pid: 14039
2014-03-09 23:11:21 [14040] [INFO] Booting worker with pid: 14040
2014-03-09 23:11:21 [14041] [INFO] Booting worker with pid: 14041
2014-03-09 23:11:31 [14040] [DEBUG] GET /done
2014-03-09 23:12:02 [14029] [CRITICAL] WORKER TIMEOUT (pid:14040)
2014-03-09 23:12:02 [14029] [CRITICAL] WORKER TIMEOUT (pid:14040)

Cheers

Nick Santos

unread,
Mar 10, 2014, 1:01:13 AM3/10/14
to django...@googlegroups.com
Hey Henrique,

Can you send the code for the view that generates the page?

-Nick


--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/641f550d-4e8b-4a36-b76f-93d8100f3500%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Henrique Oliveira

unread,
Mar 10, 2014, 8:53:22 AM3/10/14
to django...@googlegroups.com, ni...@enviroconsumer.org
Hi Nick,

views.py

class LaunchRockForm(ModelForm):
    class Meta:
        model = LaunchRock
        exclude = ['sign_date', 'ip', 'http_refer']

    def clean_email(self):
        try:
            LaunchRock.objects.get(email=self.cleaned_data['email'])
        except LaunchRock.DoesNotExist:
            return self.cleaned_data['email']
        raise forms.ValidationError(_("This is email is already in database."))


def signup(request):
    if request.method == 'POST':
        form = LaunchRockForm(data=request.POST)
        if form.is_valid():
            launch = LaunchRock.objects.create(email=form.cleaned_data['email'], sign_date=datetime.datetime.now(),
                                               ip=request.META['REMOTE_ADDR'], http_refer=request.META['HTTP_REFERER'])
            return HttpResponseRedirect("/done/")
    else:
        form = LaunchRockForm()
    return render_to_response('launch.html', {'form': form}, context_instance=RequestContext(request))


def done(request):
    return render_to_response('done.html')


models.py

class LaunchRock(models.Model):
    email = models.EmailField()
    sign_date = models.DateTimeField(default=datetime.datetime.now)
    ip = models.IPAddressField()
    http_refer = models.TextField(blank=True, null=True)

    class Meta:
        db_table = 'launch'

    def __unicode__(self):
        return self.email

Henrique Oliveira

unread,
Mar 10, 2014, 7:57:42 PM3/10/14
to django...@googlegroups.com
The request do not reach the view

John Deng

unread,
Mar 13, 2014, 4:40:19 AM3/13/14
to django...@googlegroups.com
Hi, Henrique.

Did you config the url.py?

在 2014年3月10日星期一UTC+8下午12时14分18秒,Henrique Oliveira写道:
Reply all
Reply to author
Forward
0 new messages