Hi Anand, I'm not running this on GAE; it's on an Amazon EC2 instance that I fully control. Sorry if I was unclear about that.
Thanks :) -Adrian On Mon, Mar 14, 2011 at 1:47 PM, Anand Chitipothu <[email protected]>wrote: > 2011/3/14 Adrian Petrescu <[email protected]>: > > Hey guys, > > I'm probably doing something wrong, so I thought I'd ask here to see if > > anybody has any ideas; basically, I'm trying to pass in some datetime > > objects into a template, and have the template compute some timedeltas > from > > them and format them nicely. To that end, in my code file I added: > > modules = {'datetime': datetime, 'time' : time} > > render = web.template.render('templates/', globals=modules) > > And I try to use time from the template: > > $time.strptime(log['end_time'], "%Y-%m-%d %H:%M:%S") > > However, it fails at runtime with the error: > > RuntimeError: cannot unmarshal code objects in restricted execution mode > > I did some Google'ing and it turns out this is an error thrown out by > > Restricted Python, which (according to this > > thread: https://groups.google.com/forum/#!topic/webpy/oC4L2tCkSJs) is > not > > used by web.py. Does anyone know what is going on, and if this is doable? > > I'm totally willing to find a way to just turn off any execution > > restrictions, I'm not at all concerned about safety here (this won't be > > running externally). > > Templates are compiled into Python code before executing and Google > App Engine doesn't allow compiling code at runtime. You need to > compile your templates before deploying to avoid that. > > See this cookbook entry for more details: > > http://webpy.org/cookbook/templates_on_gae > > -- > 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. > > -- 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.
