You can also import index.py in webstart.py

import web
from urls import url_mappings
from index import index




On Wed, Mar 20, 2013 at 12:04 AM, Anand Chitipothu <[email protected]>wrote:

> You've passed class names from index.py and globals() from webstart.py
> to the application. So webpy is trying to find the classes in
> webstart.py.
>
> Try moving the app = web.application(...) to index.py. That'll solve
> your problem.
>
> Anand
>
> On Tue, Mar 19, 2013 at 8:56 PM, thefourtheye
> <[email protected]> wrote:
> > I am noob to both the Python and web.py world.
> >
> > I created three files and they are as follows
> >
> > urls.py
> >
> > url_mappings = (
> > '/', 'index'
> > )
> >
> > index.py
> >
> > class index:
> > def GET(self):
> > return "<h1>Hello World</h1>"
> >
> > def POST (self):
> > return "<h1>Hello World in POST</h1>"
> >
> > webstart.py
> >
> > import web
> > from urls import url_mappings
> >
> > if __name__ == "__main__":
> > app = web.application (url_mappings, globals())
> > app.run()
> >
> >
> > I am starting my dev server with python webstart.py and it starts at port
> > 8080
> >
> > But when I visit localhost:8080 in my browser, it returns None to browser
> > and in the logs I see
> >
> > 127.0.0.1:52822 - - [19/Mar/2013 20:44:18] "HTTP/1.1 GET /" - 405
> Method Not
> > Allowed
> > 127.0.0.1:52822 - - [19/Mar/2013 20:44:18] "HTTP/1.1 GET /favicon.ico"
> - 404
> > Not Found
> >
> >
> > What am I missing?
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "web.py" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to [email protected].
> > To post to this group, send email to [email protected].
> > Visit this group at http://groups.google.com/group/webpy?hl=en.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
>
>
> --
> Anand
> http://anandology.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "web.py" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/webpy?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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


Reply via email to