About Overwritable Form FIeld Templates
By default, form field templates are taken from Django installation and third-party app directories, but the TEMPLATES
setting is ignored. This is what to set in the settings to overwrite some of those templates with your project templates:
import django
INSTALLED_APPS = [
"django.forms",
# ...
]
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [
os.path.join(BASE_DIR, "myproject", "templates"),
],
"APP_DIRS": True,
"OPTIONS": {
# ...
},
},
]
FORM_RENDERER = "django.forms.renderers.TemplatesSetting"
Tips and Tricks Programming Development Django 5.x Django 4.2 Django 3.2
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.