I have the following structure
/templates/base.html
templates/index.html — here i have inherited base.html which has JS and CSS and both working fine when this pagge is accessed
/template/app/some.html —- i use {%extends “base.html”%} only is getting inherted but not the CSS and JS
can any one tell what i am doing wrong
Thank You
Your issue happens because when you are in say:
mysite.com/index.html, your files pointed tocss/mysite.csstry to load frommysite.com/css/mysite.css, but when you are inmysite.com/foo/bar.htmlit tries to load frommysite.com/foo/css/mysite.cssThe best option is to point to your CSS/JS with an absolute path, so say your CSS always loads from
/css/mysite.cssand your JS loads from/js/mysite.js. Notice the prepended/as this is what instructs the browser to always look for this path relative to the base domain.