Hi all,

I've been using web.py for some small projects that only involve less than a
dozen URLs. A lot of times I put all URL handlers in the same .py file (with
utility classes in separate files.) Everything works great.

In other cases I put the URL handlers in separate .py files in the same
directory as the main app.py file which contains the start up code and
session initialization. In order for the URL handlers to access the session
variable, they import the app.py as well. Because app.py also import all
the URL handlers for hot reloading to work, this sometimes creates a
circular reference if I'm not careful. I wonder how you initialize and
reference the session global variable in your web.py projects?

When a project continues to grow I am thinking about putting URL handlers
in a directory (say, urlhandlers directory), and put all utility classes in
another
directory called utils. To access them, I can put a __init__.py in each
directory
and access them by modules. Do you think this is a good idea?

More generally, is there a recommended way of organizing files and
directories
for web.py projects so that file hot loading and global variables such as
session
work and with the minimum possibility of issues such as circular imports?

Thanks,
Jack

-- 
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