关于在 django 中管理静态内容的简单问题

发布于 2024-09-18 10:10:02 字数 409 浏览 3 评论 0原文

我在 django 中有一个简单的网站,其中内容是静态的。在我使用“AboutUs.html”、“OurServices.html”或“c​​ontact.html”等模板的地方..现在我想使用 django admin,这样任何人都可以使用 WYSIWYG 编辑器更改这些页面的内容(因为那些会改变这个不知道html)..我想创建一个名为StaticContent的类,类似于:

class StaticContent(models.Model):
    content = models.TextField("content")

然后我教说也许django中有一些东西可以做到这一点,但我在文档中找不到任何内容。

你知道 django 是否有一些模块或其他东西来管理管理中的静态内容吗?

提前谢谢!

I have a simple website in django where the content is static. Where i use templates like "AboutUs.html" ,"OurServices.html" or "contact.html".. now i want to use the django admin so anyone could change the content for those pages using a WYSIWYG editor (cause the people who will change this dont know html).. i wanted to create a class called StaticContent, something like:

class StaticContent(models.Model):
    content = models.TextField("content")

then i taught that maybe there's something in django that can do that, but i couldn't find anything in the documentation.

Do you know if django has some module or something to manage this static content in the admin?

Thxs in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最单纯的乌龟 2024-09-25 10:10:02

What you're looking for is the flatpages app that is bundled with Django

http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文