1👍
add this in your code
import os
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')
]
0👍
try to add this in urls.py but this is only work when we posting any images from templates and stored in static files
urlpatterns = [
path('admin/', admin.site.urls),
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
also try this
comment your STATIC_ROOT = os.path.join(BASE_DIR, 'static')
- [Answered ]-Python urllib2 request is prepending newline chars to post data
- [Answered ]-How turn {{ fieldset.fields }} in Django template into a string?
- [Answered ]-Save a form using django's authentication framework?
0👍
update settings.py
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'static')],
'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',
],
},
},
]
- [Answered ]-Django to javascript template tag
- [Answered ]-Django is unable to load angular chunks
- [Answered ]-How to populate model with having model django?
Source:stackexchange.com