You can’t embed a variable tag within another tag. You need to use the add filter to concatenate the components of that path. You can do something like: <link rel="stylesheet" href="{% static 'css/'|add:page_styl|add:'.css' %}" />
Also, I would suggest getting rid of the if tag by setting page_styl to “layout” in the context for the home page and remove the condition. (Or changing the name of the file from “layout.css” to “home-page.css”.)
Finally, in the future, it would be more helpful when requesting assistance to provide more details as to what error message(s) you are receiving or what’s not working when you try it.
See: How do I ask a good question? - Help Center - Stack Overflow for some ideas as to what information to include in your posts.
Thanks a lot for support Ken.
i will be more careful next time to provide more details of course.
There is no Error Message just the HTML didn’t read style sheet, and render without style.
about If Condition: if home page i need to load the layout.css only i will set the home page style inside and if another page i will set each page style in a separate file, about us will be about.css - contact us will be contact.css, so i don’t kill me files from huge styles.
about concatenate variables i will dig after it,
thanks a lot again for support,