Hello, I migrated templates from per-app level to project level. Now after the migration, everything is working except the pages where I’m using custom checkboxes.
Do you have any idea what is wrong ?
(As said, everything else is working so as a workaround I quickly created again templates folder inside of app and copy-pasted this single file back.)
This is the custom checkbox definition inside of my forms.py
:
class CustomCheckboxInput(forms.CheckboxInput):
template_name = 'myapp/forms_widgets/checkbox_custom.html'
And here is TEMPLATES
from my settings.py
:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'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',
],
},
},
]
The error trace is also mentioning that the issue comes from my view function which looks like this:
def landing_page(request):
...
return render(request, 'myapp/landing_page.html', context)