在Django应用程序中提供静态网页的最佳方法是什么? [英] What is the best way to serve static web pages from within a Django application?

查看:105
本文介绍了在Django应用程序中提供静态网页的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个相对简单的 Django 应用程序,除了该页面是应用程序大多数动态部分所在的页面,我需要一些根本不会动态显示的页面(关于常见问题解答等) 。将这些集成到Django并仍然使用Django模板引擎理想的最佳方法是什么?我是否应该为每个模板创建一个模板,然后使用一个仅呈现该模板的视图?

I am building a relatively simple Django application and apart from the main page where most of the dynamic parts of the application are, there are a few pages that I will need that will not be dynamic at all (About, FAQ, etc.). What is the best way to integrate these into Django, idealing still using the Django template engine? Should I just create a template for each and then have a view that simply renders that template?

推荐答案

您是否看过平面页面在Django中?它可能会满足您的所有需求。

Have you looked at flat pages in Django? It probably does everything you're looking for.

这篇关于在Django应用程序中提供静态网页的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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