On Fri, 2009-01-09 at 14:00 +0100, Olivier Guilyardi wrote:
> Hi,
> 
> We have developed Telemeta, a "pluggable" Django application (to be added to
> INSTALLED_APPS). It works great. We now need to support per-project templates
> customization as one can do for the admin.
> 
> Telemeta provides a bunch of default templates. Once one has created a new
> django project, and installed telemeta, there is a need to customize the
> templates for this particular project.
> 
> So, as it's done for the admin in my_project/templates/admin, I would like to
> make it possible to create a my_project/templates/telemeta directory and put
> customized templates in there, overloading default templates.
> 
> How can I add support for this optional templates/telemeta directory,
> automatically, whenever one has installed telemeta ?

The telemeta source would need to support this directly, by passing a
list of template names to render_to_response() (not just a single
template name). Have a look at the usage of render_to_response() in
django/contrib/admin/options.py, for example.

Alternatively, it could use select_template() as documented in [1].
Particularly, see the "Tip" in that piece of documentation. That
describes the method used.

[1]
http://docs.djangoproject.com/en/dev/ref/templates/api/#the-python-api

Since the Telemeta website seems to be crashing at the moment, I can't
see if they're set up to support that or not, but a quick search through
the source should reveal the details.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to