[web2py] response.render not using the right view

2016-03-19 Thread Jacob Thoennes
I'm using the ajax strategy suggested by mdipierro here https://groups.google.com/d/msg/web2py/5rIQhH-RD28/Rp54nhJ1j28J My code looks like this: In default.py: def update_stackItems(): stackID = request.args[0] stack = session.stack_dict[int(stackID[5:])] return response.render(URL(

Re: [web2py] response.render in controller raises NameError

2015-07-25 Thread David Zejda
I see. Thank you for your help! David On 22.7.2015 19:16, Anthony wrote: It has nothing to do with WSGI. Now that I look back at the code, I see that run_view_in() simply looks for a "compiled" folder, and if it exists, it assumes all views are compiled. That means if any part of the app is com

Re: [web2py] response.render in controller raises NameError

2015-07-22 Thread Anthony
It has nothing to do with WSGI. Now that I look back at the code, I see that run_view_in() simply looks for a "compiled" folder, and if it exists, it assumes all views are compiled. That means if any part of the app is compiled, even a single non-compiled view will lead to this error (which is w

Re: [web2py] response.render in controller raises NameError

2015-07-22 Thread David Zejda
Thank you, Anthony! I deploy the app using commandline script which packs the application sources, uploads them on server and calls a server-side script which compiles the app. So, on the server side in the application folder I have standard directory structure - source files in 'models', 'c

Re: [web2py] response.render in controller raises NameError

2015-07-22 Thread Anthony
Probably you chose "Pack compiled" in admin, which packs only the compiled models, controllers, and views. If you didn't compile the views, then your packed app will have no views. Instead, choose "Pack custom", and be sure to include the /views folder. A while back, I submitted a patch that wo

Re: [web2py] response.render in controller raises NameError

2015-07-22 Thread David Zejda
Hi, Anthony, thank you for explaining the meaning of the 'context' argument. It works now as expected. The suggested approach with variable in extend is neater. It works well in my development environment. But in the production environment I use web2py behind Apache through WSGI. If I compil

[web2py] response.render in controller raises NameError

2015-07-21 Thread Anthony
Your context is an empty dict, so the template doesn't see any of the usual globals. Anyway, this approach is unnecessary. The argument to extend can be a Python expression, do just use the extendtempl variable in the extend statement in the view. The only drawback is that you won't be able to

[web2py] response.render in controller raises NameError

2015-07-21 Thread David Zejda
Hi :) I would like to run one app on more domains and allow users to apply per-domain specific skins. E.g. default/index.html should be extending layout_xyz.html for domain xyz.com, but layout_abc.html for domain abc.com. As covered in the documentation, conditional {{extend}} does not work.

[web2py] response.render

2010-09-16 Thread JC11
Is it possible to call response.render(view, vars) in a controller, but have the view not a file, but as a string ? The reason I want to do this is that I am getting the view from a database table and replacing bits of it with python code snippets {{some code}} which response.render will evaluate.

[web2py] response.render without layout

2010-01-30 Thread villas
How does one retrieve a html view without including the layout? e.g. In my controller: outstr = response.render('item.html',dict(myvar=myvar)) My view item.html is: This is my variable: {{=myvar}} Note the view does not {{extend layout.html}}. However 'outstr' still ends up containing the