在按照上的说明为草稿设置“标记”按钮的示例中,我发现它不适用于Wagtail 4.1.1。这是我能找到的最简单的入门例子。按照这些步骤,我在一个新的app文件夹中创建了一个wagtail_hooks.py文件,并且在富文本编辑器中或旁边都没有出现按钮。
这是我在models.py的全部资料
from django.db import models
from wagtail.models import Page
from wagtail.fields import RichTextField
from wagtail.admin.panels import FieldPanel
class
我有一个带有StreamField的页面模型:
from wagtail.core.fields import StreamField
from wagtail.embeds.blocks import EmbedBlock
class SomeModel(Page):
stream_field = StreamField(
[
("embed", EmbedBlock()),
]
)
我想通过代码创建一个新的SomeModel实例,并用一个嵌入值填充stream_field。例如。
from wagta
我在Wagtail中定制了500和404个错误页面。我可以通过输入错误的url来预览404页面。我只是想知道怎样才能预览500页? 自定义页面有链接到静态图像,我需要检查是否正常工作。 我的urls.py from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from wagtail.contrib.sitemaps.views import s
我正在尝试将我自己的css插入到摇尾管理页面中。
在回答时,С使用钩子insert_editor_css。我在我的应用程序文件夹中创建了wagtail_hooks.py,并在下面添加了代码:
from django.utils.html import format_html
from django.contrib.staticfiles.templatetags.staticfiles import static
from wagtail.wagtailcore import hooks
@hooks.register('insert_editor_css')
def e
我想有一个TableBlock显示在我的管理面板,但它不能正常显示。 下面是我得到的错误: ? 下面是代码块: from wagtail.contrib.table_block.blocks import TableBlock
from wagtail.core.blocks import StreamBlock
from wagtail.core.fields import StreamField
class BaseStreamBlock(StreamBlock):
table = TableBlock()
class ArticlePage(Page):
pa
我在wagtail网站上关注了Brent Clark。我试图在后端使用GraphQL和Python+Django添加wagtail cms到react应用程序中。当我尝试迁移时,我得到了这个错误:
RuntimeError: Model class wagtail.core.models.Site doesn't declare
an explicit app_label and isn't in an application in INSTALLED_APPS
pip冻结提供:
aniso8601==3.0.2
beautifulsoup4==4.6.3
certifi=
我使用Wagtail的创建了一个基本的Wagtail博客页面。但是,现在我想在博客页面上创建一个过滤器,允许我通过多个博客标签对博客页面进行索引。
Wagtail已经提供了Django REST框架和Django-Taggit。有没有一种简单的方法可以使用预先打包的依赖项在models.py和HTML模板中创建过滤器?
如果没有,我还可以使用哪些其他方法来通过多个博客标签来索引Wagtail的博客页面?
from django.db import models
from modelcluster.fields import ParentalKey
from modelcluster.cont
我有一个这样的模型:
from wagtail.wagtailcore.models import Page
class Blog(Page):
created = models.DateTimeField(auto_now_add=True)
...
..
现在,我的默认设置是,如果我的插件是hi-there,博客帖子可以在site_url:/hi-there/上访问,但我想通过site:url/2014/02/05/hi-there/访问它页面有各种方法,比如url, url_path,我应该覆盖哪一个,在wagtail中实现这样的东西的最佳实践是什么?
我刚刚在我的项目上安装了,并将博客添加到INSTALLED_APPS中,并将url(r'^blog/', include('blog.urls', namespace="blog")),添加到主urls.py中。迁移后,它返回django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
我双倍地检查了我的base.py,它在SECRET_KEY上有一个字符串,但仍在返回错误。这是中间件和INSTALLED_APPS
INSTALLED_
我已经建立了自己的Django项目。我没有自己的应用程序安装。那是以后用的。我所做的是复制‘基地’和‘博客’应用程序从面包店演示到我自己的项目。这些运行良好,我可以访问博客页和管理网站从摇尾。唯一的问题是,根url现在是一个空白页(不能添加摇尾字段或其他任何内容)。我的摇尾主页现在在ip-adress/home上,它应该是在ip-adress上。这是我的url-config:
from wagtail.admin import urls as wagtailadmin_urls
from wagtail import urls as wagtail_urls
from wagtail.docu
我正在尝试将Wagtail CMS集成到我现有的Django项目中。除了之外,我还创建了一个名为wagtail_hooks.py的文件。到目前为止一切都很好,但我需要使用WYSIWYG编辑器上的Wagtail CMS。是否有一种方法可以访问Wagtail的models.py,以便在模型级别上使用第三方WYSIWYG编辑器?
MY_APP/wagtail_hooks.py
from wagtail.contrib.modeladmin.options import (
ModelAdmin, modeladmin_register)
from .models import Store