Django.core.exceptions.ImproperlyConfigured: the TEMPLATE_DIRS parameter must be a tuple. Correct the settings

Hey, I'm trying to learn how to use django, I have very basic knowledge, and I'm quite confused about what is happening right now. So I try to follow some online video tutorial and I got a little stuck, so I was wondering if anyone could help. I am on a poppy and I'm in a terminal and that tells me 'django.core.exceptions.ImproperlyConfigured: the TEMPLATE_DIRS parameter should be a tuple. Correct your settings. And on top of that theres heaps of more lines and things that I don't understand! Anyway, I would really appreciate it if someone could tell me what to do, I really don't know. In addition, the annoying thing with online video, as a rule, I send my problems to the reporter, and he comes back to me a few days later, so you know any other good resources besides here.who have a strong django community where I can also ask questions and learn django .. THANKS.

+4
source share
1 answer

It looks like you forgot to add a comma to the setting TEMPLATE_DIRS. You have something like this:

TEMPLATE_DIRS = (
    os.path.join(BASE_DIR, 'templates')
)

But it should be:

TEMPLATE_DIRS = (
    os.path.join(BASE_DIR, 'templates'),
)

Pay attention to the comma after the call os.path.join().

+7
source

All Articles