【问题标题】:Wagtail + Django problem - page is redirecting to wagtail although the url is not for the wagtail pageWagtail + Django 问题 - 尽管 url 不是 wagtail 页面,但页面正在重定向到 wagtail
【发布时间】:2018-11-14 09:58:25
【问题描述】:
url(r'^$', views.HomePage.as_view(), name='homepage'),

class HomePage(RedirectView):
    def get(self, request, *args, **kwargs):
        print('check')
        return render(request, url)

这是html:

<a href="{% url 'public_portal:homepage' %}">

虽然,我得到了一个完整的 wagtail Page 模型设计的页面。 有谁知道为什么会这样?

【问题讨论】:

    标签: python html django wagtail


    【解决方案1】:

    我相信,如果您没有正确命名 Wagtail 网址,它们会覆盖您的网站网址。文档建议将它们放在/pages/ 等路径下。

    https://docs.wagtail.io/en/v2.4/getting_started/integrating_into_django.html#url-configuration

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-03
      • 1970-01-01
      相关资源
      最近更新 更多