2011/3/28 Nathan <[email protected]>:
> Hi,
>
> I'm wondering if anybody can help with this because I'm going nuts
> with it!
>
> I have setup a second web.py project in exactly the same way as a
> working one I have with WSGI but every time I try to run it, I get
> errors saying it can't find my other modules.
>
> It works fine under the built in web server (python code.py)
>
> Error and trace:
> ----------------------------------------------------------------------------------------------------------
>  mod_wsgi (pid=17252): Target WSGI script '/srv/www/app/code.py'
> cannot be loaded as Python module.
> mod_wsgi (pid=17252): Exception occurred processing WSGI script '/srv/
> www/app/code.py'.
> Traceback (most recent call last):
>   File
>     "/srv/www/app/code.py", line 18, in <module>
>       urls = urls + user.urls + part.urls + supplier.urls
>       AttributeError: 'module' object has no attribute 'urls'
> Target WSGI script '/srv/www/app/code.py' cannot be loaded as Python
> module.
> ----------------------------------------------------------------------------------------------------------
> TOP OF code.py
> ----------------------------------------------------------------------------------------------------------
> #!/usr/bin/python
> import sys, os
> abspath = os.path.dirname(__file__)
> sys.path.append(abspath)
> os.chdir(abspath)
>
> import web, db, settings, sql
> import user, part, supplier
>
> urls = (
>    '/', 'dashboard'
> )
> urls = urls + user.urls + part.urls + supplier.urls
>
> app = web.application(urls, globals())
> application = app.wsgifunc()
> ...

Try printing user.__file__, part.__file__, supplier.__file__ after
importing those modules.
I suspect that it is importing a wrong module.

Anand

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to