Problem with Django styling
Hi new to django but I'm having issues with the stylesheets (CSS) of pages.
my settings.py contains
MEDIA_ROOT = ''
MED开发者_运维知识库IA_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
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.
精彩评论