I am fairly new to django and programming too. I have seen the static question asked here severally, but I have a documentation specific question. According to the official django documentation, the static files should be put inside the app folder, then create a subfolder named static, then app, then the file. for example, I have a project called Sheecooks. Inside the sheecooks, I have several django apps and among them is the nav app. so here is how i structured my css. Sheecooks > nav>static>nav>styles.css. However, my styles were not reflecting. I tried everything that has been suggested on this platform. The 'django.contrib.staticfiles'app is installed in my settings.py and yes i checked for all the spelling mistakes.
I was following the documentation but changing the polls example into nav but I didn't get it to work until I removed the nav subfolder. So what I have at the moment is sheecooks>nav>static>style.css. While this works, i am afraid that the documentations states that it "it would actually be a bad idea. Django will use the first static file it finds whose name matches, and if you had a static file with the same name in a different application, Django would be unable to distinguish between them. We need to be able to point Django at the right one, and the best way to ensure this is by namespacing them. That is, by putting those static files inside another directory named for the application itself."
My question is, any suggestion on what I should do? Has anyone else tried this and failed and how did you fix it? Plus, I am loading the stylesheet from the master template and if I try to load from the specific app which is nav, it doesn't work.
what you say i do,
i create project (test) and in create app(run) and in app in create static folder and in that folder in create first.css
so the path is
now I create another app whose path is
However, when I run it, all the code works and shows the output,
In your, you do something wrong and check your code.