KrisF
KrisF

Reputation: 1411

Django looking in wrong directory for app's templates

App name is invitations. I'd expect it to look in

$PROJECT/invitations/templates/invite_many.html

but instead it's looking in

$PROJECT/invitations/templates/invitations/invite_many.html

Here are the potentially relevant settings:

import os.path

ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
PROJECT_NAME = os.path.basename(ROOT_DIR)

def ABS_PATH(*args):
    return os.path.join(ROOT_DIR, *args)

def ENV_SETTING(key, default):
    import os
    return os.environ.get(key, default)

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    # 'django.template.loaders.eggs.Loader',
)

TEMPLATE_DIRS = (
    ABS_PATH('templates'),
)

Upvotes: 1

Views: 1459

Answers (1)

Aamir Rind
Aamir Rind

Reputation: 39659

I think you are giving template path as invitations/invite_many.html whereas you should only give invite_many.html

Upvotes: 3

Related Questions