[google-appengine] Re: Django, including a file
Have you looked at template-inheritance. I use it and it works great. It's more flexible then {% include %} http://docs.djangoproject.com/en/dev/topics/templates/#template-inheritance http://www.djangoproject.com/documentation/0.96/templates/#template-inheritance Make sure title.html is not a static file. 2009/1/22 Larry : > > Well I have some templates that I render and they all have a titlebar > so I would like to include that snippet from another file. I put that > in a file named title.html and use the code: > > {% include "title.html" %} > > wherever I want it. However, that the template is rendered without the > title HTML included! I'm sure this must be easy but I'm probably > missing something. > > What do I need to change to get this to work? > > Thanks, > Larry > > PS: I have already check > http://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#include > to no avail. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Django, including a file
Thanks, but I really just want to use includes. On Jan 22, 4:52 pm, djidjadji wrote: > Have you looked at template-inheritance. > I use it and it works great. It's more flexible then {% include %} > > http://docs.djangoproject.com/en/dev/topics/templates/#template-inher...http://www.djangoproject.com/documentation/0.96/templates/#template-i... > > Make sure title.html is not a static file. > > 2009/1/22 Larry : > > > > > Well I have some templates that I render and they all have a titlebar > > so I would like to include that snippet from another file. I put that > > in a file named title.html and use the code: > > > {% include "title.html" %} > > > wherever I want it. However, that the template is rendered without the > > title HTML included! I'm sure this must be easy but I'm probably > > missing something. > > > What do I need to change to get this to work? > > > Thanks, > > Larry > > > PS: I have already > > checkhttp://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=old... > > to no avail. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Django, including a file
Has anyone got include working? I've been searching everywhere but find any simple examples of AppEngine including templates! On Jan 22, 4:58 pm, Larry wrote: > Thanks, but I really just want to use includes. > > On Jan 22, 4:52 pm, djidjadji wrote: > > > Have you looked at template-inheritance. > > I use it and it works great. It's more flexible then {% include %} > > >http://docs.djangoproject.com/en/dev/topics/templates/#template-inher.. > > > Make sure title.html is not a static file. > > > 2009/1/22 Larry : > > > > Well I have some templates that I render and they all have a titlebar > > > so I would like to include that snippet from another file. I put that > > > in a file named title.html and use the code: > > > > {% include "title.html" %} > > > > wherever I want it. However, that the template is rendered without the > > > title HTML included! I'm sure this must be easy but I'm probably > > > missing something. > > > > What do I need to change to get this to work? > > > > Thanks, > > > Larry > > > > PS: I have already > > > checkhttp://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=old... > > > to no avail. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Django, including a file
> Has anyone got include working? I've been searching everywhere but > find any simple examples of AppEngine including templates! > {% include %} works for me, I'm using app-engine-patch. Which version of Django do you use? What is your folder structure, where the templates are kept (both the parent and the included one)? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Django, including a file
I'm using the templates that are currently inbuilt into AppEngine (I'm not including Django myself). My folder structure has the parent and template in the root directory and also a copy of the template in / templates. Would getting the latest Django be necessary? Or do I just need to tweak things? Thanks, Lster On Jan 24, 2:01 am, Alexander Kojevnikov wrote: > > Has anyone got include working? I've been searching everywhere but > > find any simple examples of AppEngine including templates! > > {% include %} works for me, I'm using app-engine-patch. > > Which version of Django do you use? What is your folder structure, > where the templates are kept (both the parent and the included one)? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Django, including a file
Including the templates would be helpful. http://dpaste.com is your friend. =) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Django, including a file
Please post here your templates and also the app.yaml file, you can use dpaste as @theillustratedlife has suggested. On Jan 26, 8:27 am, Larry wrote: > I'm using the templates that are currently inbuilt into AppEngine (I'm > not including Django myself). My folder structure has the parent and > template in the root directory and also a copy of the template in / > templates. > > Would getting the latest Django be necessary? Or do I just need to > tweak things? > > Thanks, > Lster > > On Jan 24, 2:01 am, Alexander Kojevnikov > wrote: > > > > Has anyone got include working? I've been searching everywhere but > > > find any simple examples of AppEngine including templates! > > > {% include %} works for me, I'm using app-engine-patch. > > > Which version of Django do you use? What is your folder structure, > > where the templates are kept (both the parent and the included one)? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Django, including a file
Good point. =) Here is my page that is being rendered without the template included: http://silicon.appspot.com/readdoc?id=12619 Here's the template (contained in / and /templates): http://silicon.appspot.com/readdoc?id=12620 And finally, here is my app.yaml file: http://silicon.appspot.com/readdoc?id=12480 Thanks again for the continued help! :) On Jan 26, 12:19 am, Alexander Kojevnikov wrote: > Please post here your templates and also the app.yaml file, you can > use dpaste as @theillustratedlife has suggested. > > On Jan 26, 8:27 am, Larry wrote: > > > I'm using the templates that are currently inbuilt into AppEngine (I'm > > not including Django myself). My folder structure has the parent and > > template in the root directory and also a copy of the template in / > > templates. > > > Would getting the latest Django be necessary? Or do I just need to > > tweak things? > > > Thanks, > > Lster > > > On Jan 24, 2:01 am, Alexander Kojevnikov > > wrote: > > > > > Has anyone got include working? I've been searching everywhere but > > > > find any simple examples of AppEngine including templates! > > > > {% include %} works for me, I'm using app-engine-patch. > > > > Which version of Django do you use? What is your folder structure, > > > where the templates are kept (both the parent and the included one)? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Django, including a file
I've created a sample project with just one page and the inclusion works fine both in the SDK and in production. Take a look, may be you will spot differences with your project: http://www.sendspace.com/file/qrsyjh On Jan 27, 8:47 pm, Larry wrote: > Good point. =) > > Here is my page that is being rendered without the template > included:http://silicon.appspot.com/readdoc?id=12619 > > Here's the template (contained in / and > /templates):http://silicon.appspot.com/readdoc?id=12620 > > And finally, here is my app.yaml > file:http://silicon.appspot.com/readdoc?id=12480 > > Thanks again for the continued help! :) > > On Jan 26, 12:19 am, Alexander Kojevnikov > wrote: > > > Please post here your templates and also the app.yaml file, you can > > use dpaste as @theillustratedlife has suggested. > > > On Jan 26, 8:27 am, Larry wrote: > > > > I'm using the templates that are currently inbuilt into AppEngine (I'm > > > not including Django myself). My folder structure has the parent and > > > template in the root directory and also a copy of the template in / > > > templates. > > > > Would getting the latest Django be necessary? Or do I just need to > > > tweak things? > > > > Thanks, > > > Lster > > > > On Jan 24, 2:01 am, Alexander Kojevnikov > > > wrote: > > > > > > Has anyone got include working? I've been searching everywhere but > > > > > find any simple examples of AppEngine including templates! > > > > > {% include %} works for me, I'm using app-engine-patch. > > > > > Which version of Django do you use? What is your folder structure, > > > > where the templates are kept (both the parent and the included one)? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Django, including a file
Thanks! I have found my problem... When I render the templates I first load the Template and then for each page render I create a Context object and do: self.response.out.write(templateObject.render(contextObject)) When I change this back to: self.response.out.write(template.render(templatePath, contextVals)) it works perfectly. I wasn't aware of the difference except thought that loading in the template object would be faster since it removes repeated operations. Can I still use the template-object method and includes together? Thanks loads! At the very least I know the problem and can get it working now. =) On Jan 27, 11:03 am, Alexander Kojevnikov wrote: > I've created a sample project with just one page and the inclusion > works fine both in the SDK and in production. Take a look, may be you > will spot differences with your project: > > http://www.sendspace.com/file/qrsyjh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---