Answer the question
In order to leave comments, you need to log in
Django templates, how to correctly build a file structure from many html parts?
I have a standard structure
├───fonts
├───img
├───js
├───сss
├───libs
└───index.html
I get a multi-page site and would like to know how to properly organize the structure project, if you put them in folders by subject - there will be a hassle with relative links to the image, etc., tell me how to do it right, I'm learning. All good and understanding)
Answer the question
In order to leave comments, you need to log in
Why are you throwing templates in a folder with statics? They should be in the templates folder of the project and/or application. Read carefully the documentation on templates, or at least the training section dedicated to them.
Links to statics must be specified through the {% static "css/style.css" %} tag, then they will be relative everywhere. When deploying, you do manage.py collectstatic and all static from the project and applications will be collected in the directory specified in settings.py, then you give this folder through nginx.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question