Django静态页面? [英] Django static page?

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

问题描述

我想制作一个静态页面,只有当用户点击我的一个模型中提供的链接时,该页面才会显示给用户。我可以通过单独制作一个Python页面来调用它,但是我想要从Django调用它。用户界面应该仅使用Django API构建。

I want to make a static page which will be shown to the user only if he/she clicks on a link provided in one of my models. I can do this by making a Python page alone and calling it, but I want it be called from Django. The user interface should constructed using the Django API only.

任何建议?

推荐答案

绕过视图呈现静态模板,在urls.py中添加这一行。例如关于我们页面可以是

Bypassing views to render a static template, add this line in "urls.py". For example "About Us" page could be

(r'^about', 'django.views.generic.simple.direct_to_template', {'template': 'path/to/about_us.html'}),

这篇关于Django静态页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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