Replies: 1 comment
-
My suggestion: Override the widget class and set the template you want to replace. I actually am unsure, if I understood your question correctly. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I want to override one of the widgets (some css styles changes) from 'templates/formset/bootstrap/widgets/file.html'
What I have done so far:
1 ) I created new file called 'file.html' in folder structure as it's shown below:
BASE_DIR/templates/formset/bootstrap/widgets/file.html
2 ) Checked if 'formset' is added to INSTALLED_APPS
3) Checked Templates config:
TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", "DIRS": [BASE_DIR / "templates"], "APP_DIRS": True, } ]
I've done step by step everthing from: https://docs.djangoproject.com/en/4.2/howto/overriding-templates/
If I run the view with form, nothing changes. Django loads orginal file from virtual env. If I delete this file in virtual env, Django throwns error:
TemplateDoesNotExist at / formset/bootstrap/widgets/file.html
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions