11π
β
You might need to specify the template directories in settings.py, if you havenβt already.
e.g. in my settings.py, I have:
ROOTDIR = os.path.abspath(os.path.dirname(__file__))
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
ROOTDIR + '/logistics/templates',
)
π€kafuchau
- Django-tables2 set of columns
- Django β Search related fields
- Django database delete specific number of entries
- Updating selection of objects, each with a different value in bulk (Django)
0π
You need to update your "Templates" configuration in your setting file like the below:
enter image description here
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['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',
],
},
},
]
Worked for me.
- TypedChoiceField or ChoiceField in Django
- Increment Page Hit Count in Django
- Django model field validation without a custom form
- Accessing form fields as properties in a django view
Source:stackexchange.com