I've made a simple web.py application that works great until...I want
to throw in a sub application. Looking at the cookbook (http://
webpy.org/cookbook/subapp) I thought this would be very straight
forward but I can't get it to work for the life of me.
I've got the following code
Apache httpd
WSGIScriptAlias / /var/www/webapps/apps/main.py
FILE 1
------------------------------------------------------
/var/www/webapps/apps/main.py
from webpy.dark import *
from model.customer import User
from model.test import get_props()
#subapps
from apps.dashboard import app_dashboard
urls = (
'/', 'index',
'/dashboard', 'app_dashboard'
)
class index:
def GET(self):
user = User.fetch('phantomxc')
res = get_props()
return jrender('test.html', {'results':res, 'user':user})
application = web.application(urls, globals(),
autoreload=False).wsgifunc()
FILE 2
------------------------------------------------------
/var/www/webapps/apps/dashboard.py
from webpy.dark import *
from model.customer import User
urls = (
'', 'dash',
'/', 'dash',
'dashboard/', 'dash',
'/dashboard/', 'dash',
'/dashboard', 'dash',
)
class dash:
print 'IT PRINTS THIS SO ITS LOADING THIS MODULE'
def GET(self):
print 'hmmm why do I not print?'
user = User.fetch('phantomxc')
return jrender('dashboard.html', {'user':user})
app_dashboard = web.application(urls, locals())
I added all the urls just for testing purposes thinking I might be
doing it wrong. Any input would be greatly appreciated.
--
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.