I have the following directory structure:
app/
bin/
serve.py
resources/
__init__.py
someresource.py
Where, serve.py is:
import os, sys, web
base = os.path.abspath(os.path.dirname(sys.argv[0]))
sys.path.append(os.path.join(base, os.path.pardir))
urls = ('/', 'hellew')
from resources.someresource import hellew
app = web.application(urls, globals())
and someresource.py is:
class hellew:
def GET(self):
return "Hellew World!"
and when I tri to access http://localhost:8080/, I get:
Traceback (most recent call last):
File "c:\home\Dev\Python25\Lib\site-packages\web\application.py",
line 180, in process
return p(lambda: process(processors))
File "c:\home\Dev\Python25\Lib\site-packages\web\application.py",
line 501, in processor
h()
File "c:\home\Dev\Python25\Lib\site-packages\web\application.py",
line 67, in reload_mapping
self.mapping = getattr(mod, mapping_name)
TypeError: getattr(): attribute name must be string
Ouch. Am I doing anything wrong?
--Jonas Galvez
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---