如何在Django中使用CSS? [英] How do I use CSS in Django?

查看:125
本文介绍了如何在Django中使用CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Django创建我的应用程序,我想知道我如何使Django使用我的CSS文件?

I am creating my application using Django, and am wondering how I can make Django use my CSS file? What settings do I need to do to make Django see the css file?

NB:在本地机器上

推荐答案

如果您使用开发服务器,请按照 django项目的静态文件管理指南来设置您的URL,然后引用模板中的媒体文件 - 例如,来自 / site_media的图片文件夹中的图片/images/foo.gif

If you're using the development server follow the django project's how-to guide for managing static files to setup your URL's, then reference you media files in the template -- say, an image inside an image folder from /site_media/images/foo.gif.

这篇关于如何在Django中使用CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆