Hm, I did as instructed and got:
Traceback (most recent call last):
File "bin/serve.py", line 8, in <module>
from resources.app import app
File "c:\home\src\sojus-api-v2\bin\..\resources\app.py", line 3, in
<module>
app = web.auto_application()
File "C:\home\Dev\Python25\lib\site-packages\web\application.py",
line 434, in __init__
application.__init__(self)
File "C:\home\Dev\Python25\lib\site-packages\web\application.py",
line 60, in __init__
module_name = modname(fvars)
File "C:\home\Dev\Python25\lib\site-packages\web\application.py",
line 53, in modname
file, name = fvars['__file__'], fvars['__name__']
KeyError: '__file__'
When trying to start up bin/serve.py
--Jonas Galvez
On Nov 24, 1:43 am, Anand <[EMAIL PROTECTED]> wrote:
> > Suppose a resource looks like this:
>
> > class Resource:
> > uri = "/api/resources/(\d+)"
> > def GET(self, id):
> > return "You're trying to query for Resource[%s]!" % id
>
> Looks like what you want to use is web.auto_application.
>
> app/
> bin/
> serve.py
> resources/
> __init__.py
> someresource.py
> app.py
>
> # app.py
>
> app = web.auto_application()
>
> # someresource.py
>
> from app import app
>
> class Resource(app.page):
> path = "/api/resources/(\d+)"
> def GET(self, id):
> return "You're trying to query for Resource[%s]!" % id
>
> # serve.py
>
> from resource.app import app
>
> if __name__ == "__main__":
> app.run()
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---