带蓝图的 web2py
将蓝图与 web2py 一起使用是常见还是推荐?蓝图与默认的web2py样式表和layout.html冲突吗?在 web2py 应用程序中包含蓝图的正确方法是什么?
我认为应该将蓝图目录添加到 static/css 目录中,并将推荐链接添加到该部分中的layout.html 中。
Is using blueprint with web2py common or recommended? Does blueprint conflict with the default web2py stylesheets and layout.html? What is the correct way to include blueprint in a web2py application?
I presume the blueprint directory should be added to static/css directory and the recommended links added to the layout.html in the section.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
web2py 主要涉及服务器端,因此您可以在客户端使用任何您想要的 CSS、JS 等。
请注意,您根本不必使用 web2py 的默认样式表或layout.html。当前的 web2py“welcome”应用程序基于 Skeleton 框架,因此您可能需要删除 skeletal.css 和更改布局以适应蓝图网格(假设您想使用蓝图的网格)。您也可以不使用大部分 web2py.css,尽管可能有一些项目值得保留。无论如何,如果您在 web2py.css 之后加载蓝图,它应该覆盖任何可能发生冲突的内容。
在layout.html中,您可能需要保留
{{include 'web2py_ajax.html'}}
,也许还有response.flash、auth.navbar()和response.menu,具体取决于您的需要。是的。
web2py is primarily concerned with the server side, so you can use whatever you want on the client side in terms of CSS, JS, etc.
Note, you don't have to use web2py's default stylesheets or layout.html at all. The current web2py "welcome" app is based on the Skeleton framework, so you may want to remove skeleton.css and change the layout to accommodate the Blueprint grid (assuming you want to use Blueprint's grid). You can probably also do without most of web2py.css, though there may be a few items worth keeping. Anyway, if you load Blueprint after web2py.css, it should override anything that would conflict.
From layout.html, you'll probably want to keep
{{include 'web2py_ajax.html'}}
, and maybe response.flash, auth.navbar(), and response.menu, depending on your needs.Yes.