Actually, I just use this construct:
'DIRS': [
    # insert your TEMPLATE_DIRS here
    os.path.join(BASE_DIR, 'project_name', 'templates'),
],


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of John Wilkinson
Sent: Monday, April 23, 2018 7:47 AM
To: Django users
Subject: Cannot find template files for 1.11

I am having trouble setting up django to find my template file I have created.

The settings.py has, among other sections, the following:


INSTALLED_APPS = [
    'designer.apps.DesignerConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]


TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': 
["/home/john/git/primaryWindingsCalculator/windingCalculator/designer/template"],
        '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',
            ],
        },
    },
]

If I take the entry out of the DIRS array, django won't be able to find my 
template file, I have put in a directory:

designer/template/designer/

I thought that if my app was in the INSTALLED_APPS list, then it would look in 
there dor my templates, and in
designer/static/designer/

for all static files, that it can't find also by the way.

Any help much appreciated.

Many thanks,
John.
--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f86815a6-9d73-4ede-a65d-f6c62919e8eb%40googlegroups.com<https://groups.google.com/d/msgid/django-users/f86815a6-9d73-4ede-a65d-f6c62919e8eb%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ef4cb7c15a2045a3b1ba3c44d3c76922%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.

Reply via email to