开发者

Problem with Django styling

开发者 https://www.devze.com 2023-01-03 17:35 出处:网络
Hi new to django but I\'m having issues with the stylesheets (CSS) of pages. my settings.py contains MEDIA_ROOT = \'\'

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.

0

精彩评论

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