我可以使用 Turbogears 开发移动网站吗?
是否可以使用 Turbogears 开发网页的移动版本?有人可以给我举个例子以及它是如何完成的吗?
Is it possible to develop mobile versions of webpages using Turbogears? Can someone please show me an example and how it is done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可能想看看 tgext.mobilemiddleware 它提供了 @ hide_mobile 装饰器,允许为移动设备公开不同的模板引擎。它还提供了一个 tg.request.is_mobile 属性,可在控制器内部使用该属性在涉及移动设备时应用不同的执行路径。
You might want to take a look at tgext.mobilemiddleware it makes available an @expose_mobile decorator that permits to expose a different template engine for mobile devices. It also provides a tg.request.is_mobile attribute that can be used inside controllers to apply different execution paths when a mobile device is involved.
是的,这是可能的。 TurboGears 只是服务器端技术,您可以从 TurboGears 生成任何类型的演示文稿 (HTML)。我建议您查看一些有关开发适合移动设备的网站的文章和/或这个。
我认为没有任何人可以向您展示移动友好的 TurboGears 应用程序的任何示例,它仍然看起来与任何其他 TurboGears 应用程序相同。最终结果只会有一些不同的 HTML 输出。
没有什么灵丹妙药可以让现有网站适用于所有移动设备(据我所知)。祝你好运。
Yes, it is possible. TurboGears is just the server side technology, you can generate any type of presentation (HTML) from TurboGears. I recommend taking a look at some articles about developing mobile-friendly websites and/or this.
I don't think there is any example that anyone can show you of a mobile friendly TurboGears application, it will still look the same as any other TurboGears application. The final result will just have some different HTML output.
There is no magic bullet that will just make an existing website work for all mobile devices (that I know of). Good luck.
我建议您使用 Turbogears 邮件列表(或者 Google 网上论坛上的群组),其中您可以从经常使用 Turbogears 的人那里得到更具体的答案。
I'd recommend the Turbogears mailing list (or, the group on Google Groups), where you can get more specific answers from people who use Turbogears regularly.
“移动网站”的最简单版本就是 CSS。向被识别为移动设备的用户代理显示网站的简化版本。
The simplest version of a "mobile site" is simply CSS. Display a simplified version of the site to USERAGENTS that are identified as mobile.