3👍
✅
Looking at your settings file, it is probably because you’re passing just a string as the list/tuple of strings….
I think you mean to do
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static"), # notice the comma here
)
This is one of the problems with Python that you need to add an explicit comma to differentiate between a tuple and just parenthesis
1👍
you can find more detail here
setting.py
STATIC_URL = '/static/' STATICFILES_DIRS = [
os.path.join(BASE_DIR,"static")]
urls.py
from django.conf import settings
from django.conf.urls.static import static
urlpatterns[
'your url'
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
- [Django]-Virtualenv, sys.path and site-packages
- [Django]-OAuth authentication fails for google data APIs for hosted domains using gdata
Source:stackexchange.com