The STATIC_URL forms a prefix to the path component relative to STATIC_ROOT. What you specify in STATIC_URL is not part of the actual path in which the files are stored. What you identify as the parameter in the static tag is the relative directory and file name of the file to be referenced, relative to STATIC_ROOT, not STATIC_URL.
So, in other words, if you have STATIC_URL as I defined in my previous example (STATIC_URL='staticfiles/bands_ratings/'), and STATIC_ROOT=/var/www/html/
Then the tag {% static 'css/file.css' %} is going to render a url as staticfiles/bands_ratings/css/file.css.
The file itself is going to be collected to /var/www/html/css/file.css.
It is then up to your webserver configuration (e.g. nginx / apache) to know that the url staticfiles/bands_ratings/css/file.css should refer to the physical file /var/www/html/css/file.css.
(I should clarify that your STATIC_ROOT should never be inside your project directory in a production environment, and hopefully you know better than to be using runserver in a deployment environment.)
Now the CSS is working thank you so much. This had been driving me crazy over the past 48 hours. I took your advice and re-read your post 2. I guess something clicked and it works now.
Although i am not sure what you mean here ’ (I should clarify that your STATIC_ROOT should never be inside your project directory in a production’
Where should it be then if not in the top level directory of the project?
Thank you so much for your patience i really appreciate it. Also i am a noob, only started learning python 18 months ago and django 2.5 months ago so still plenty to learn, especially in regards to how servers work…
Outside your project. Whether you choose to put it in a standard location like /var/www/html, or somewhere else is entirely up to you. But you generally don’t want your web server having direct access to your project directory. (There’s no need for it, and you typically want to prevent any unintentional data leakage.)