开发者

django css path

开发者 https://www.devze.com 2023-01-06 01:16 出处:网络
i want to include a css file into the header of my documents, but i have a few questions: 1.Where should i set the path to media, and it should be a relative/absolute path? In settings.py, i \'ve trie

i want to include a css file into the header of my documents, but i have a few questions: 1.Where should i set the path to media, and it should be a relative/absolute path? In settings.py, i 've tried setting MEDIA_URL but my style is still 'unseen' 2.how can i make the htmls to inheric that syle (for not adding the href in every page)开发者_StackOverflow?

i've tryed writing like:

<link href="/media/default.css" rel="stylesheet" type="text/css" />

having set

MEDIA_URL = '/media/'

but it doesn't work. media is a folder inside my project

shold i set the Media _root to? how should this be done? thanks


you also need to handle the url that serves the file, http://docs.djangoproject.com/en/dev/howto/static-files/

0

精彩评论

暂无评论...
验证码 换一张
取 消