Answer the question
In order to leave comments, you need to log in
Where does the countdown start when specifying STATIC_URL in settings.py in django?
I have a project with the following hierarchy:
-myproject
--myapp1
--myapp2
--myapp3
--projectapp
---settings.py
---wsgi.py
---urls.py
--static_content
---media
---static
----css
--templates
---*.html
<link rel="stylesheet" href="{{ STATIC_URL }}css/base.css" type="text/css">
Answer the question
In order to leave comments, you need to log in
STATIC_URL is the part of the URL where the static path will start. Suppose
now, when parsing the URL, Django will immediately understand that the view requests
are static content and you don’t need to do anything there, you just need to return the file.
In addition to these parameters in settings.py for statics, you also need to specify the PATH_TO_STATIC parameter - this is the folder where Django
will add all static files when executing the command.
But in each application, I usually do this:
<link rel="stylesheet" href="{% static 'desktop/libs/bootstrap/css/bootstrap.css' %}"/>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question