apache - 500 Error when trying to pass Python object to HTML using Flask/mod_wsgi -
i've got flask application running on top of apache using mod_wsgi. i'm trying pass object i've created template this:
@app.route('/<user>') def viewuser(user): return render_template('viewuser.html', user = builduser(user))
where builduser returns instance of class 'user' based on username.
viewuser.html accesses of fields of 'user' this:
hello, {{ user.name }}!
this runs fine on local flask server, browser returning '500 internal server error' when try access http://myurl.com/testuser.
templates otherwise working fine - example if change view function return value to:
return render_template('test.html', user = user)
and test.html contains:
hello, {{ user }}!
everything displays correctly. (http://myurl.com/testuser displays 'hello, testuser!')
does have idea why passing simple values works on apache mod_wsgi, passing objects works on non-production flask server?
Comments
Post a Comment