https://docs.djangoproject.com/en/dev/ref/templates/api/
Search on template loaders and this url will explain it. The following is from this url django.template.loaders.app_directories.Loader Loads templates from Django apps on the filesystem. For each app in INSTALLED_APPS, the loader looks for a templates subdirectory. If the directory exists, Django looks for templates in there. This means you can store templates with your individual apps. This also makes it easy to distribute Django apps with default templates. For example, for this setting: INSTALLED_APPS = ('myproject.polls', 'myproject.music') ...then get_template('foo.html') will look for templates in these directories, in this order: /path/to/myproject/polls/templates/foo.html /path/to/myproject/music/templates/foo.html Note that the loader performs an optimization when it is first imported: It caches a list of which INSTALLED_APPS packages have a templates subdirectory. This loader is enabled by default. On Feb 10, 1:21 pm, Patrick Wellever <pwelle...@gmail.com> wrote: > Thanks, I think that gets me most of the way there, but the part I'm having > more trouble with is figuring out how to deal with the other template > loaders, such as 'django.template.loaders.app_directories.Loader', that don't > pull from the 'TEMPLATE_DIRS' setting. I'd like the solution to take those > into account if possible. > > Is there any way to iterate over whatever list of source directories Django > builds when it wants to go looking for a template? > > Thanks, > Patrick > > > > > > > > On Friday, February 10, 2012 at 1:03 PM, Python_Junkie wrote: > > The setttings file is a python module. > > > See page > >https://docs.djangoproject.com/en/dev/topics/settings/ > > > Since the path is set for the templates. > > ******************* > > frrom the example > > > TEMPLATE_DIRS = ('/home/templates/mike') > > > in the view > > > templates=os.listdir(TEMPLATE_DIRS) > > ###template_count=len(templates) > > > create a dictionary of templates and pass it back to the rendered > > template and you have it. -- 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.