Hello, I had the same problem, but not a clue how to implement this. After Donald mentioned that the template system uses pluggable loaders, I spent some time to create one for my own use. It's very basic, but at least I believe it demonstrates how to create a template loader.
Kurtis, you can find the plugin at https://github.com/jezdez/django-dbtemplates. <https://github.com/jezdez/django-dbtemplates> Basic database loader snippet link: http://dpaste.com/638238/ > ------------------------------------------------------------------------ > > Javier Guerra Giraldez <mailto:jav...@guerrag.com> > October 20, 2011 01:59 > > > On Wed, Oct 19, 2011 at 5:17 PM, Kurtis Mullins > > note that 'document' in MongoDB parlance means 'complex document', as > in 'more complex than a field'. in this case, the template is just a > (long?) text string. any good DB (relational or not) should perform > similarly, given the same hardware. > > ------------------------------------------------------------------------ > > Kurtis Mullins <mailto:kurtis.mull...@gmail.com> > October 20, 2011 01:17 > > > Good idea. I'm going to check out MongoDB for this. Looks like there's > already some Django tools for it out there. > > > -- > You received this message because you are subscribed to the Google > Groups "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > ------------------------------------------------------------------------ > > Donald Stufft <mailto:donald.stu...@gmail.com> > October 20, 2011 00:57 > > > If I wanted maximum performance from a distributed on the fly template > system. I'd probably store them in a fast document db. > > On Wednesday, October 19, 2011 at 5:54 PM, Kurtis Mullins wrote: > > > -- > You received this message because you are subscribed to the Google > Groups "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > ------------------------------------------------------------------------ > > Kurtis Mullins <mailto:kurtis.mull...@gmail.com> > October 20, 2011 00:54 > > > Very true, I could definitely implement it as a pluggable loader. I'll > try to find the DB Template Loader too. I'm mainly concerned with this > being a large bottle neck for our front-facing pages so I'm not sure > which path to choose. Maybe some R&D is in order :) Thanks! > > > -- > You received this message because you are subscribed to the Google > Groups "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > ------------------------------------------------------------------------ > > Donald Stufft <mailto:donald.stu...@gmail.com> > October 20, 2011 00:52 > > > The template system uses pluggable loaders that can locate a template > based upon it's name. So using that you can store your template > anywhere. There is already an app for storing templates in the db, you > could easily make one to store it somewhere else as well. > > On Wednesday, October 19, 2011 at 5:48 PM, Kurtis wrote: > > > -- > You received this message because you are subscribed to the Google > Groups "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
<<inline: compose-unknown-contact.jpg>>