On 4/15/08, Brandon Taylor <[EMAIL PROTECTED]> wrote:
>
> Hi everyone,
>
> I'm sure there's a better way to do this in my settings.py file:
>
> TEMPLATE_DIRS = (
> os.path.join(os.path.dirname(__file__), 'pages',
> 'templates').replace('\\', '/'),
> os.path.join(os.path.dirname(__file__), 'articles',
> 'templates').replace('\\', '/'),
> os.path.join(os.path.dirname(__file__), 'books',
> 'templates').replace('\\', '/'),
> os.path.join(os.path.dirname(__file__), 'faqs',
> 'templates').replace('\\', '/'),
> os.path.join(os.path.dirname(__file__), 'kumus',
> 'templates').replace('\\', '/'),
> os.path.join(os.path.dirname(__file__), 'links',
> 'templates').replace('\\', '/'),
> os.path.join(os.path.dirname(__file__), 'techniques',
> 'templates').replace('\\', '/'),
> os.path.join(os.path.dirname(__file__), 'tenets',
> 'templates').replace('\\', '/'),
> )
Untested, but something like this should work:
f = os.path.dirname(__file__)
app_names = ['pages', 'articles', 'books', etc. etc.]
dirs = [os.path.join(f, app, 'templates').replace('\\','/') for app in
app_names]
TEMPLATE_DIRS = tuple(dirs)
Jay P.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---