Read:
http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Access_Rights_Of_Apache_User
and watch:
http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Conference_Presentations
to see what is said about permissions, especially about permissions on
home directories.
BTW:
sys.path.append('/usr/lib/python2.7/site-packages')
should not be required.
You should also perhaps learn about Python virtual environments and use them.
Graham
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/lXc5zlfKMTkJ.
> To post to this group, send email to mod...@googlegroups.com.
> To unsubscribe from this group, send email to
> modwsgi+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.
Graham
On 14 April 2012 18:23, badc0re <dame.jo...@gmail.com> wrote:
> I have made it with:
>
> site.addsitedir('/home/baddc0re/Desktop/htdocs/')
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/CbF0Lerej88J.
Does the folder SE_controller has __init__.py inside it ? That
required for python to recognize the folder as a package:-
$ ls SE_controller
__init__.py SE_text_query SE_text_parser
> Code:
>
> # -*- coding: utf-8 -*-
> import sys, os
> sys.path.append('/home/baddc0re/Desktop/htdocs') # the folder with the
> modules needer
> sys.path.append('/opt/hypertable/0.9.5.6/lib/py')
> sys.path.append('/opt/hypertable/0.9.5.6/lib/py/gen-py')
> sys.path.append('/usr/lib/python2.7/site-packages')
> from SE_controller.SE_text_parser import * #the error
> from SE_controller.SE_text_query import * #the error
> from hypertable.thriftclient import *
> from hyperthrift.gen.ttypes import *
> def application(environ, start_response):
> status = '200 OK'
> output = 'Hello World!>'
> response_headers = [('Content-type', 'text/plain'),
> ('Content-Length', str(len(output)))]
> start_response(status, response_headers)
>
>
> return [output]
You can try debug this by executing the script with python and see if
you can import the module. Run this from some other directory:-
$ python /home/baddc0re/Desktop/htdocs/index.wsgi
does it run without error ? If not then definitely the import path is
wrong and not a problem with mod_wsgi. Check what sys.path contain by
placing the pdb inside the code:-
import sys, os
sys.path.append('/home/baddc0re/Desktop/htdocs') # the folder with the
modules needer
sys.path.append('/opt/hypertable/0.9.5.6/lib/py')
sys.path.append('/opt/hypertable/0.9.5.6/lib/py/gen-py')
sys.path.append('/usr/lib/python2.7/site-packages')
import pdb;pdb.set_trace()
from SE_controller.SE_text_parser import *
Now when you run it as:-
$ python /home/baddc0re/Desktop/htdocs/index.wsgi
You'll be dropped into pdb console. Print out what sys.path contains:-
pdb > sys.path
Finally, what is the output of:-
$ which python