0

Hi new to django but I'm having issues with the stylesheets (CSS) of pages.

my settings.py contains

MEDIA_ROOT = ''
MEDIA_URL = ''
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), 'templates'),
)

please can someone help me shed some light on what I need to do to get the CSS styles working in my templates

Thanks

3
  • Using the dev server or in production? Commented Jun 15, 2010 at 9:17
  • dev server but was hoping to make use of import os.path to make things relative Commented Jun 15, 2010 at 9:20
  • Please UPDATE your question with the missing information. Don't add comments to a question which You own. Commented Jun 15, 2010 at 10:11

1 Answer 1

1

The templates setting is just for aiding when you're selecting a template file for rendering in your view handler.

If you want to serve files, such as CSS, see how to serve static files with Django, which is the easiest way. The best way, however, is to configure your server to, for the CSS (and other static files) requests, serve the files himself instead of handing the request to the Django handler.

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.