Check and see if you have had a deadline exceeded error during instance 
startup, prior to the instance exhibiting this problem.

T

On Wednesday, January 15, 2014 11:06:55 PM UTC+8, Jeff Potter wrote:
>
> I am having this problem with coto-boilerplate right now. Stacktrace for 
> the problem below. Stopping and starting a new instance fixes the problem.
>
> Traceback (most recent call last): 
> File 
> "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py",
>  
> line 1529, in __call__ rv = self.router.dispatch(request, response) 
> File 
> "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py",
>  
> line 1278, in default_dispatcher return route.handler_adapter(request, 
> response) 
> File 
> "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py",
>  
> line 1102, in __call__ return handler.dispatch() 
> File 
> "/base/data/home/apps/s~<site>/1-1.373006929445588669/boilerplate/lib/basehandler.py",
>  
> line 88, in dispatch webapp2.RequestHandler.dispatch(self) 
> File 
> "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py",
>  
> line 572, in dispatch return self.handle_exception(e, self.app.debug) 
> File 
> "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py",
>  
> line 570, in dispatch return method(*args, **kwargs) 
> File 
> "/base/data/home/apps/s~<site>/1-1.373006929445588669/boilerplate/handlers.py",
>  
> line 1526, in get return self.render_template('home.html', **params) 
> File 
> "/base/data/home/apps/s~<site>/1-1.373006929445588669/boilerplate/lib/basehandler.py",
>  
> line 320, in render_template 
> self.response.write(self.jinja2.render_template(filename, **kwargs)) 
> File 
> "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2_extras/jinja2.py",
>  
> line 158, in render_template return 
> self.environment.get_template(_filename).render(**context) 
> File 
> "/base/data/home/runtimes/python27/python27_lib/versions/third_party/jinja2-2.6/jinja2/environment.py",
>  
> line 894, in render return self.environment.handle_exception(exc_info, 
> True) 
> File "boilerplate/templates/home.html", line 1, in top-level template 
> code {% extends base_layout %} 
> File "boilerplate/templates/base.html", line 40, in top-level template 
> code 
> File "boilerplate/templates/home.html", line 6, in block "canonical" {% 
> block canonical %}{{ uri_for("home") }}{% endblock %} 
> UndefinedError: 'uri_for' is undefined
>
> uri_for is defined in basehandler.py like so
> def jinja2_factory(app):
>     j = jinja2.Jinja2(app)
>     j.environment.filters.update({
>         # Set filters.
>         # ...
>     })
>     j.environment.globals.update({
>         # Set global variables.
>         'csrf_token': generate_csrf_token,
>         'uri_for': webapp2.uri_for,
>         'getattr': getattr,
>     })
>     j.environment.tests.update({
>         # Set test.
>         # ...
>     })
>     return j
>
> All the routes work perfectly fine until the instance gets into a funky 
> state where no uri_for call works (seen it for other uris as well).
>
> any ideas?
>
> On Monday, July 16, 2012 12:34:35 AM UTC-7, Thomas Marban wrote:
>>
>>
>> Ever since including webapp2.uri_for in my webapp2_extras.jinja2 config 
>> via
>>
>>         'globals': {
>>             'uri_for' : webapp2.uri_for
>>             }, 
>>
>>  I'm getting an undefined error every time I change a python file and 
>> load the app for the first time. It won't come up on subsequent requests. 
>> Also tried to inject it into globals via a Jinja2 factory but same result. 
>> Any hints?
>>
>> UndefinedError: 'uri_for' is undefined
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to