My Folder structure is something like this
-web
-app.py
-code.py

########################################
app.py

import web

urls = (
    '/', 'foo',
    '/advanced', 'advanced'
)

#autoreload = false since I use add_mapping and it wont work with
autoreload
app = web.application(urls,autoreload=False)

#Initiate sessions and other objects for which app is needed

############################################
code.py

import web
from app import app, urls
import classes.py # which contain class definitions

app.run


The problem is while creating the app in app.py the globals namespace
does not contain the classes definition hence my app does not work. I
know auto_application may be a solution but I am looking for something
which reloads the class definitions to the app again from the global
namespace which I can call in code.py

The main reason I have segregated code.py and app.py is because I have
to instantiate an auth object. Now this auth object is used as a
decorator @auth.protected in classes.py. If I instantiate it in
code.py the import classes.py at the top of the file gives me an
error.

Would be great if I get some help with that as well

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

Reply via email to