I am new at Django, and as I'm about to finalize my project, I toggled DEBUG
from True
to False
to see if there are any actual errors. Now the static files are giving me an error 404
which I found the reason here.
As a work around, I included this in my urls.py
urlpatterns = urlpatterns + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
I then did python manage.py collectstatic
Included this in my settings.py
STATIC_ROOT = 'static'
STATIC_URL = '/static/'
Now static files load whenever I toggle DEBUG
.
Am I doing this incorrectly?