Question

I know that this question has been asked often before, but no one of other help me to fix my problem. I'm getting a TemplateDoesNotExists from my Django app running on Elastic Beanstalk, the funny part is that:

  1. my django settings are perfectly defined
  2. the template exists (I can ssh on my ec2 and see it among the other)
  3. in the same folder where the template is not found there is another template that is used successfully
  4. by typing ls -hal in that folder, I can see that both have the same user/group/permissions:

    -rw-rw-rw- 1 wsgi root 2.2K Mar 22 16:12 BaseEmailTemplate.html

    -rw-rw-rw- 1 wsgi root 312 Mar 22 16:12 DefaultNewsletterTemplate.html

  5. on my local machine I have no issues ("works on my machine" TM :D)

Now, the particularity of that template (DefaultNewsletterTemplate.html) is that is being loaded "manually" using loader.get_template:

from django.template.loader import get_template
get_template('the_app/the_template.html')

since I use it to render my newsletter in a Celery task... but once again the same happens for the BaseEmailTemplate.html which is used for each email communication (DefaultNewsletterTemplate.html extends it)... so what's going on??? What should I try to do?

Was it helpful?

Solution

Solved! It turned out, that the problem was related to the user used by Celery (and managed by Supervisor) that had not the right privileges. Using root user works perfectly!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top