EDIT: I figured out that the CSS file was not being displayed because I copied the link tag pointing to the CSS file from Microsoft Word, so the quotations marks around rel="stylesheet" were not the right type of quotations marks!!
The settings.py file in the project folder defines the STATIC_URL variable as '/static/'
The CSS file is inside the app folder: DjangoProject/shop/static/shop/style.css
The {% load static %} is at the top of the HTML template (if I use "staticfiles" instead of "static", I get an error)
The CSS file is linked using href="{% static 'shop/style.css' %}"
The CSS file loads and is visible when I analyze the "view page source", but the actual CSS is not displayed on the webpage.
What am I doing wrong? I'm using Django version 3.0.7
EDIT:
I've also tried defining the STATICFILES_DIRS in the settings.py file, but that doesn't do anything. Nor does adding the additional code below to the project urls.py file.
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
.
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
#your url patterns
]
urlpatterns += staticfiles_urlpatterns()