集成网页和涡轮齿轮应用程序
我正在开发 Turbo Gears 2 应用程序。该应用程序引导用户回答一系列问题。我喜欢 TG2 的模板系统(这当然是想法),所以我也想将静态网页与 TG2 集成。这将使我能够抽象出页眉、侧边栏、导航栏和页脚。
请注意,我并不是在谈论将“静态”文件放置在应用程序的公共目录中。我创建了一个名为 WebController
的控制器,并通过它提供文件服务。当然,控制器的实例名称是 web
,因此我的所有页面都可以通过 URL http://mysite/web/page1.html
访问(例如)
现在问题 - 是否可以将根级别的所有页面重定向到 /web
。这样我就可以消除 HTML 页面 URL 中的 /web
。
感谢您的阅读。
I am working on a Turbo Gears 2 application. The application directs a user through a set of questions. I like the templating system of TG2 (which of course is the idea) so I want to integrate the static web pages with TG2 also. This will allow me to abstract away the headers, sidebars, navbars and footers.
Please note that I am not talking about placing my 'static' files in the public directory of the application. I created a Controller called WebController
and I am serving files through that. Of course the instance name of the controller is web
so all my pages are accessible at the URL http://mysite/web/page1.html
(for example)
Now the question - is it possible to have all pages at the root level be redirected to /web
. That way I can eliminate the /web
in URLs for HTML pages.
Thanks for reading.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我意识到我的问题有点含糊。经过我自己的研究,我发现TurboGears默认不使用路由,而是使用CherryPy调度方案。 http://nxsy.org/unscientific-and-biased -comparison-of-django-pylons-and-turbogears 对于理解 TG 的一些高层架构非常有帮助。
当我在应用程序中取得进展时,我非常依赖 stackoverflow 来解决我的问题 - 因此,希望其他人可以通过阅读该讨论而受益。
Ok I realize that my question was somewhat vague. After doing some research on my own, I found out that TurboGears does not use routes by default but uses CherryPy dispatching scheme. http://nxsy.org/unscientific-and-biased-comparison-of-django-pylons-and-turbogears was very helpful in understanding some of the high level architecture of TG.
I rely a lot on stackoverflow to solve my problems as I make progress in my application - so, here is hoping someone else can benefit by reading that discussion.