I'd like to ask for a little help. I've got a standalone file.py which has problems with rendering template to create email message. Everything is inside single file.py which suppose to execute periodic task.
message = render_to_string(
template,
context,
)
with template...
template = get_template('task.html')
or
template = get_template('tasks/task.html')
with same result
and context...
context = {
'overdue_objects': overdue_objects,
'current_week_objects': current_week_objects,
'next_week_objects': next_week_objects,
'current_month_objects': current_month_objects,
}
with settings...
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'templates'),
'/home/RafalSzymanski/ab',
'/home/RafalSzymanski/ab/tasks',
'/home/RafalSzymanski/ab/templates/tasks'
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
],
And I got error Template Does Not Exist. Why? What can I change?