I have been on holidays and just now slowly catching up. Did you resolve this
and/or what is the current problem you are having?
FWIW, that you have:
python-path=/usr/local/ZigHomeWS/zighome_rest:/usr/lib/python2.7:/usr/local/lib/python2.7/site-packages/django
looks a bit dodgy.
There should not be a need to add '/usr/lib/python2.7' to the Python path
explicitly.
Adding the directory of a package itself in:
/usr/local/lib/python2.7/site-packages/django
is also wrong.
In respect of:
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
vs:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
The former should work with all Django versions.
The latter only works for last few Django versions, back to 1.3 or 1.4 (can't
remember which).
If you are using one of the more recent Django versions though, the
startproject management command would have generated a wsgi.py file for you to
use and you wouldn't have needed to create a django.wsgi file.
What Django version are you actually using and what version of Django were you
using when you ran the startproject management command or did you ignore that
steps and create the Django project files from scratch.
Graham
On 01/10/2014, at 8:19 AM, Carlos Vicente <[email protected]> wrote:
> So... I've just realized something.
>
> From what I read from several site on the web, I should be really using this
> call:
>
> from django.core.wsgi import get_wsgi_application
> application = get_wsgi_application()
>
> on the WSGI script. Since I was getting nowhere fast with these two lines of
> code, which were crashing all the time, I remembered to call any other
> web-service that I have created and VOILA!! It works.
>
> Now, one of the major differences the two web-services, is that one, only
> parses some XML file and adds data to the sqlite3 database and the other one
> (the one that crashes), starts the whole system, which implies the creation
> of multiple threads and so forth.
>
> Thus, I'm now looking for any threads related documented issue I can find
> with modwsgi.
>
> Regards,
>
> On Sunday, September 28, 2014 3:35:19 PM UTC+1, Carlos Vicente wrote:
> I've been trying to integrate a DJANGO-REST WS into apache using MOD_WSGI,
> but after some long hours of trying to apply all debugging techniques and
> different wsgi scripts, I would appreciate some help.
>
> Server version: Apache/2.2.22 (Ubuntu)
> Python 2.7.3 (default, Feb 27 2014, 19:58:35)
> MOD_WSGI Version: 3.3
>
> Currently my WSGI file is the following:
>
> """
> WSGI config for zighome_rest project.
>
>
> It exposes the WSGI callable as a module-level variable named ``application``.
>
>
> For more information on this file, see
> https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
> """
>
>
> import os, sys
> sys.path.append('/usr/local/ZigHomeWS')
> sys.path.append('/usr/local/ZigHomeWS/zighome_rest')
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zighome_rest.settings")
>
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
> and my virtual host is configured as below:
>
> <VirtualHost *:80>
> ServerAdmin [email protected]
> ServerName my.server.name
>
>
> DocumentRoot /usr/local/DummyApp
>
>
> WSGIDaemonProcess ZigHomeWS
> python-path=/usr/local/ZigHomeWS/zighome_rest:/usr/lib/python2.7:/usr/local/lib/python2.7/site-packages/django
> WSGIProcessGroup ZigHomeWS
> WSGIApplicationGroup %{GLOBAL}
>
>
> WSGIScriptAlias /ZigHomeWS
> /usr/local/ZigHomeWS/zighome_rest/zighome_rest/WSGI/django.wsgi
> WSGIPassAuthorization On
>
>
> <Directory /usr/local/ZigHomeWS/zighome_rest>
> <Files wsgi.py>
> Order deny,allow
> Allow from all
> </Files>
> </Directory>
>
> <Directory /usr/local/DummyApp>
> Order deny,allow
> Allow from all
> </Directory>
>
> ErrorLog /var/log/apache2/error_ZigHomeWS.log
>
>
> # Possible values include: debug, info, notice, warn, error, crit,
> # alert, emerg.
> LogLevel info
>
> </VirtualHost>
>
> As soon as I call one of the services, with curl, like so:
>
> curl -X POST http://my.server.name/ZigHomeWS/execution/start/ -u user:passwd
>
>
> I get the following error logged:
>
> [Sat Sep 27 19:15:28 2014] [info] mod_wsgi (pid=13351): Adding
> '/usr/local/ZigHomeWS/zighome_rest' to path.
> [Sat Sep 27 19:15:28 2014] [info] mod_wsgi (pid=13351): Adding
> '/usr/lib/python2.7' to path.
> [Sat Sep 27 19:15:28 2014] [info] mod_wsgi (pid=13351): Adding
> '/usr/local/lib/python2.7/site-packages/django' to path.
> [Sat Sep 27 19:15:32 2014] [info] [client 46.189.221.224] mod_wsgi
> (pid=13351, process='ZigHomeWS', application=''): Loading WSGI
> script'/usr/local/ZigHomeWS/zighome_rest/zighome_rest/WSGI/django.wsgi'.
> [Sat Sep 27 18:15:33 2014] [error] No handlers could be found for logger
> "django.request"
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] mod_wsgi
> (pid=13351): Exception occurred processing WSGI script
> '/usr/local/ZigHomeWS/zighome_rest/zighome_rest/WSGI/django.wsgi'.
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] Traceback (most
> recent call last):
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File
> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line
> 187, in__call__
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] response =
> self.get_response(request)
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File
> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line
> 199, inget_response
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] response =
> self.handle_uncaught_exception(request, resolver, sys.exc_info())
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File
> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line
> 236, inhandle_uncaught_exception
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return
> debug.technical_500_response(request, *exc_info)
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File
> "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 91,
> intechnical_500_response
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] html =
> reporter.get_traceback_html()
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File
> "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 350,
> inget_traceback_html
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] return
> t.render(c)
> [Sat Sep 27 18:15:33 2014] [error] [client 46.189.221.224] File
> "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line
> 148,<span style=
> ...
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/modwsgi.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.