1👍
✅
Solution:
-
Updating
STATICFILES_DIRS
: In thesettings.py
file, the user had initially configuredSTATICFILES_DIRS
with the path'C:/user/templates/user/static'
. However, this path structure was incorrect. -
Removing Leading Slash: The user removed the leading slash before
'user/templates/user/static'
in theos.path.join
call to establish a proper path.STATICFILES_DIRS = [os.path.join(BASE_DIR, 'user/templates/user/static')]
-
Using Forward Slashes: The user ensured the use of forward slashes
/
in the directory path, even on Windows systems, as Python and Django internally handle path conversions. -
Restarting Server: After applying these changes, the user restarted the Django development server to enact the configuration.
Source:stackexchange.com