bradwhittington/django-templated-email — Issue #5: TemplateDoesNotExist
Author: gwintrob
Created: 2012-01-06 02:09:10+00:00
State: open

vanilla_django.py seems to keep defaulting to templated_email/test.txt, instead of using the custom django-templated-email variables in settings.py. I tried:

from django.conf import settings

template_name = 'test'
template_prefix=getattr(settings,'TEMPLATED_EMAIL_TEMPLATE_DIR','templated_email/')
template_suffix=getattr(settings,'TEMPLATED_EMAIL_FILE_EXTENSION','email')
prefixed_template_name = ''.join((template_prefix,template_name))
debug_string = '%s.%s' % (prefixed_template_name,template_suffix)

This correctly builds the 'TEMPLATED_EMAIL_TEMPLATE_DIR/test.TEMPLATED_EMAIL_FILE_EXTENSION' template name in debug_string using the variables in settings.py. Have you ever seen this problem? I keep making small changes but haven't found the answer.

Thank you very much for your help!