The default setting for your BASE_DIR
is to point to the directory where your manage.py
is located. Unless you've changed it, the file capstone.js
can currently be found in the following path:
os.path.join(BASE_DIR, 'capstone/static')
However, Django typically searches for a static
folder within each installed app, so in this case, using STATCFILES_DIRS
may be unnecessary.
Ensure that you have included the static files in your urls.py
.
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
# ... add the rest of your URLconf here ...
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
or
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
# ...include URLs here...
]
# static content urls
urlpatterns += staticfiles_urlpatterns()
This could be why you are encountering a 404 error.
Please note: if you already have set up static URLs, try accessing
http://127.0.0.1:8000/static/capstone.js
instead.