1

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)?

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

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.