librelist archives

« back to archive

problem with Django installation

problem with Django installation

From:
Garey Mills
Date:
2011-01-27 @ 19:01
Hi -

     I followed the instructions found in 
docs.geonode.org/1.0/deployment.html and found myself construction a
django.wsgi file that looks like this:

import os
import sys

path = '/opt/geonode'
if path not in sys.path:
     sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 
'/opt/geonode/src/GeoNodePy/geonode/settings.py'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()


I am getting the error:

[Thu Jan 27 10:57:40 2011] [error] [client *************]   File 
"/opt/geonode/django.wsgi", line 10, in ?
[Thu Jan 27 10:57:40 2011] [error] [client *************]     import 
django.core.handlers.wsgi
[Thu Jan 27 10:57:40 2011] [error] [client *************] ImportError: 
No module named django.core.handlers.wsgi


Anybody have an idea why django.core.handlers.wsgi is not being found?

Garey Mills
Library Systems Office
UC Berkeley

Re: [geonode] problem with Django installation

From:
David Winslow
Date:
2011-01-27 @ 20:54
Use:
  import site
  site.addsitedir("/opt/geonode/lib/python2.6/site-packages")

Rather than:
  import sys
  sys.path.append("/opt/geonode")

The directory that you get from unpacking geonode does not directly contain
python modules, and uses some tricks (pth files etc) which afaik are not
caught when using sys.path.append.

Hope this helps.

--
David Winslow
OpenGeo - http://opengeo.org/


On Thu, Jan 27, 2011 at 2:01 PM, Garey Mills <gmills@library.berkeley.edu>wrote:

> Hi -
>
>     I followed the instructions found in
> docs.geonode.org/1.0/deployment.html and found myself construction a
> django.wsgi file that looks like this:
>
> import os
> import sys
>
> path = '/opt/geonode'
> if path not in sys.path:
>     sys.path.append(path)
>
> os.environ['DJANGO_SETTINGS_MODULE'] =
> '/opt/geonode/src/GeoNodePy/geonode/settings.py'
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
>
> I am getting the error:
>
> [Thu Jan 27 10:57:40 2011] [error] [client *************]   File
> "/opt/geonode/django.wsgi", line 10, in ?
> [Thu Jan 27 10:57:40 2011] [error] [client *************]     import
> django.core.handlers.wsgi
> [Thu Jan 27 10:57:40 2011] [error] [client *************] ImportError:
> No module named django.core.handlers.wsgi
>
>
> Anybody have an idea why django.core.handlers.wsgi is not being found?
>
> Garey Mills
> Library Systems Office
> UC Berkeley
>

Re: [geonode] problem with Django installation

From:
Garey Mills
Date:
2011-01-27 @ 21:16
David -

     I'm using Python 2.4. Is that a problem?

Garey Mills

On 1/27/2011 12:54 PM, David Winslow wrote:
> Use:
>   import site
>   site.addsitedir("/opt/geonode/lib/python2.6/site-packages")
>
> Rather than:
>   import sys
>   sys.path.append("/opt/geonode")
>
> The directory that you get from unpacking geonode does not directly 
> contain python modules, and uses some tricks (pth files etc) which 
> afaik are not caught when using sys.path.append.
>
> Hope this helps.
>
> --
> David Winslow
> OpenGeo - http://opengeo.org/
>
>
> On Thu, Jan 27, 2011 at 2:01 PM, Garey Mills 
> <gmills@library.berkeley.edu <mailto:gmills@library.berkeley.edu>> wrote:
>
>     Hi -
>
>         I followed the instructions found in
>     docs.geonode.org/1.0/deployment.html
>     <http://docs.geonode.org/1.0/deployment.html> and found myself
>     construction a
>     django.wsgi file that looks like this:
>
>     import os
>     import sys
>
>     path = '/opt/geonode'
>     if path not in sys.path:
>         sys.path.append(path)
>
>     os.environ['DJANGO_SETTINGS_MODULE'] =
>     '/opt/geonode/src/GeoNodePy/geonode/settings.py'
>
>     import django.core.handlers.wsgi
>     application = django.core.handlers.wsgi.WSGIHandler()
>
>
>     I am getting the error:
>
>     [Thu Jan 27 10:57:40 2011] [error] [client *************]   File
>     "/opt/geonode/django.wsgi", line 10, in ?
>     [Thu Jan 27 10:57:40 2011] [error] [client *************]     import
>     django.core.handlers.wsgi
>     [Thu Jan 27 10:57:40 2011] [error] [client *************] ImportError:
>     No module named django.core.handlers.wsgi
>
>
>     Anybody have an idea why django.core.handlers.wsgi is not being found?
>
>     Garey Mills
>     Library Systems Office
>     UC Berkeley
>
>