简体   繁体   English

集成Django和Twitter Bootstrap

[英]Integrating Django And Twitter Bootstrap

我想使用我正准备开发的django应用程序的twitter bootstrap,我想知道最好的方法是什么 - 我应该'定期',即在twitter bootstrap模板中实现python代码,或者是否有任何django包,它集成在django和twitter bootsrap之间?

Django is server-side. Django是服务器端。 Twitter-Bootstrap is client-side. Twitter-Bootstrap是客户端。 There's no clash and no need for special tools to integrate. 没有冲突,也没有必要使用特殊工具进行整合。 I use both on a daily basis with no problem at all 我每天都使用它们,没有任何问题

There are many packages integrating them: https://www.djangopackages.com/search/?q=bootstrap 有许多软件包集成它们: https//www.djangopackages.com/search/?q = bootstrap

Personally I don't really understand your question though, Django takes care of html rendering and python code, twitter bootstrap does css. 就个人而言,我真的不明白你的问题,Django负责html渲染和python代码,twitter bootstrap做css。 Since you write your own templates I assume, you can integrate them when you write the templates. 由于您编写自己的模板,我假设您可以在编写模板时集成它们。

I think its best practice to keep your template clean. 我认为保持模板清洁是最佳做法。 There is no harm doing custom styling. 自定义样式没有任何害处。 Anyway, you can check this git responsibility though Django Bootstrap toolkit 无论如何,你可以通过Django Bootstrap工具包检查这个git责任

I've been using this couple pretty often so I extracted repeated patterns into the simple project skeleton: faststart-bootstrap . 我经常使用这对夫妇所以我将重复的模式提取到简单的项目框架中: faststart-bootstrap It's Django with Bootstrap 3 support. 这是支持Bootstrap 3的Django。

Pypi上的django-awesome-bootstrap在django项目中添加了twitter bootstrap和font awesome的功能,并且可以轻松集成到模板中。

Much to late to this party, but since this question did pop up on Google, I'd add that for Bootstrap3 you would use https://github.com/dyve/django-bootstrap3 . 这次聚会的时间已经很晚了,但是由于这个问题确实出现在Google上,我会在Bootstrap3中添加,你会使用https://github.com/dyve/django-bootstrap3 Disclaimer: I'm the author. 免责声明:我是作者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM