Django. TemplateDoesNotExist in case of a custom widget

If you want to use a custom widget template stored somewhere under your “TEMPLATES” directory of your project then follow these steps:

a) Use the TEMPLATES settings that you have provided in your question

b) Set the FORM_RENDERER as following in the settings.py

FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'

c) Add the app “django.forms” to the ‘INSTALLED_APPS‘ list in settings.py

Also, be sure to assign the correct path of the custom widget template relative to your “TEMPLATES” directory to “template_name” attribute of your custom widget.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)