views:

10

answers:

1

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

A: 

Your issue happens because when you are in say: mysite.com/index.html, your files pointed to css/mysite.css try to load from mysite.com/css/mysite.css, but when you are in mysite.com/foo/bar.html it tries to load from mysite.com/foo/css/mysite.css

The best option is to point to your CSS/JS with an absolute path, so say your CSS always loads from /css/mysite.css and 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.

gonchuki
Thanks for that reply i tried putting it like /media/app/css and /media/app/js accesing mysite.com/app/some.html -- which extends base.htmlIts not working yet can u just elaborate. thank you
Seema
Thanks dude putting it static worksthanks a lot
Seema

related questions