Just to give more details that I think can be relevant:
"Hi everyone,
I have a django application that works pretty fine with django web-
server.
I have a python file that uses Http() from httplib2, it works very
well! But when I create a thread and in this thread use this python
file(more precisely a class) that uses Http() it seems that I got in a
infinite loop.
I am very noob in this kind of problems, but I think the problem is in
Apache or mod_wsgi because if I use django webserver it works as well!
But if I use Apache2 + mod_wsgi it doesn't work! Other strange thing
is that in my house it works ;/, it doesn't work at my server ;(.
If I use this class(that calls Http() ) without a thread involving it,
it works fine too ;/.
This my configuration Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 PHP/
5.3.2-1ubuntu4.10 with Suhosin-Patch mod_wsgi/3.3 Python/2.7
configured -- resuming normal operations
I have tested with other python version too.
My httpd.conf:
###
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
WSGIScriptAlias / /srv/www/ufcgjudge/apache/django.wsgi
########
At sites-available/ufcgjudge:
"""
    WSGIDaemonProcess ufcgjudge processes=2 threads=15 display-name=%
{GROUP}
    WSGIProcessGroup ufcgjudge

    WSGIScriptAlias / /srv/www/ufcgjudge/apache/django.wsgi
"""
Exactly the same way that is in my house.(And works here!)

"

On Feb 11, 3:02 pm, Phyllipe <phyllipece...@gmail.com> wrote:
> My server config: Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 PHP/
> 5.3.2-1ubuntu4.10 with Suhosin-Patch mod_wsgi/3.3 Python/2.6.5
> configured -- resuming normal operations
> There is no error at apache log.
> I've tried to put:
> try:
> ...response, content...
> ...print "NEXT"
> except Exception as detail:
> ..print detail
> None of those prints were used ;/ Seems that I get an infinite loop at
> response, content...
> But just saying again, if I try "response, content" without using a
> thread, it works very nice!
> And if I try response, content with django webserver it works nice
> too!
>
> On Feb 11, 11:37 am, Phyllipe <phyllipece...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I have a python file that works as well, it connects in another
> > website, doing something like that:
> > 'response, content = self.http.request('http://www.spoj.pl/', 'POST',
> > headers=self.headers, body=urlencode(self.bodyLogin))'
> > It goes inside a class, when I run it in a thread it does not works.
> > If I try with runserver it works as well! But with Apache2 and
> > MOD_WSGI doesnt work!
> > I debugged somethings, I've tried to connect without using the
> > thread(calling the method in some view) and it worked.
> > But when I use my SingleTon class that has a bounded semaphores that
> > creates a thread and in that thread class this method that was talking
> > before, it stops in the response, content part.
> > So I did a little more tests, I've created a thread in my views and in
> > that thread called this method exactly the same way that I called
> > without threads and that worked, but it has not worked ;/
> > I've putted some prints in my code that is how I discovered the line
> > that has the bug, I've putted a print before call 'response, content'
> > and a print after, the before print appears but not the last, the
> > strange thing its that does not raise any kind of exception, cause I
> > have a try:, except Exception in a while True and it does not executes
> > the before print again...
> > some thing like
> > while True:
> > ....try:
> > ........print
> > ........response....
> > ....except Exception as detail:
> > .......pass
> > So I'm pretty sure that my bug is something related to Threads +
> > httplib2, if I use only httplib2 works as well!
> > If I use only django server works as well if threads and httplib2.
> > But when I try to deploy in my university server with apache2 and
> > mod_wsgi it bugs ;/
> > At my house with apache2 and mod_wsgi works as well
> > I have already installed apache2-threaded-dev...

-- 
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