- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发一个日历应用程序作为我的 django cms 项目中的 apphook。我想使用命名空间,但似乎无法再解析我的 url。这是cms_app.py
:
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class SchedulerApphook(CMSApp):
name = _("Scheduler")
urls = ["scheduler_app.urls"]
app_name = "cab_calendar"
apphook_pool.register(SchedulerApphook)
urls.py
在我的应用程序中:
from django.conf.urls import patterns, include, url
from . import views
from scheduler_app.views import EventList, EventDetail
from datetime import datetime
from django.views.generic.base import RedirectView
urlpatterns = patterns('',
# Monthly views
url(r'^month/(1[0-2]{1}|[1-9]{1})/([0-2][0-9]{3})', views.calendar , name='calendar'), #cab/month/1-12/1900-2999
url(r'^month', RedirectView.as_view(url ='/cab/month/%s/%s' % (datetime.now().month, datetime.now().year)), name='today'), ## monthly view of today
# Weekly view
url(r'^week/(?P<day>((3[0-1]{1})|([1-2]{1}[0-9]{1})|([1-9]{1})))/(?P<month>(1[0-2]{1}|[1-9]{1}))/(?P<year>([1-2][0-9]{3}))', views.week_calendar, name='week_calendar'),
url(r'^week', RedirectView.as_view(url ='/cab/week/%s/%s/%s' % (datetime.now().day, datetime.now().month, datetime.now().year)), name='week_calendar'),
# Daily views
url(r'^day/(?P<day>((3[0-1]{1})|([1-2]{1}[0-9]{1})|([1-9]{1})))/(?P<month>(1[0-2]{1}|[1-9]{1}))/(?P<year>([1-2][0-9]{3}))' , views.day_calendar , name='day_calendar'), #cab/day/1-31/1-12/1900-2999
url(r'^day', RedirectView.as_view(url = '/cab/day/%s/%s/%s' % (datetime.now().day, datetime.now().month, datetime.now().year)), name='day_calendar'), # daily view of today
url(r'^events', EventList.as_view(), name='events'),
url(r'^event/(?P<pk>\d+)', EventDetail.as_view(), name='event_detail'),
# No selected view -> default = today monthly
url(r'^.*', RedirectView.as_view(url ='/cab/month/%s/%s' % (datetime.now().month, datetime.now().year)), name='today'),
)
{% url 'cab_calendar:calendar' %}
NoReverseMatch at /en/cab/month/6/2015
u'cab_calendar' is not a registered namespace
最佳答案
按照 CMS 当前加载通过 apphook 附加的应用程序的方式,您必须在将应用程序附加到页面后重新启动服务器。
命名空间的注册仅在服务器启动时发生,尽管在需要重新加载时会触发一个信号,因此您可能能够将某些内容连接到该信号。
Apphook docs ;
As mentioned above, whenever you add or remove an apphook, change the slug of a page containing an apphook or the slug if a page which has a descendant with an apphook, you have to restart your server to re-load the URL caches. To allow you to automate this process, the django CMS provides a signal
cms.signals.urls_need_reloading
which you can listen on to detect when your server needs restarting. When you run manage.py runserver a restart should not be needed.
关于Django CMS apphook 命名空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30921039/
Episerver CMS,我想使用 CMS 发布一个简单的通知模式。我不熟悉 CMS。是否有一些网站可以指导我了解 Episerver CMS 的工作原理。向移动网站发布新内容和新模式 最佳答案 您
我喜欢 Drupal 中的分类法,并考虑在其上为一个已经上线多年的网站构建一个 CMS。我想保留数据库原样(它是 mySQL),以确保旧的 CMS 也能正常工作 - 一些使用它的人不愿意学习新东西。相
我正在使用 DjnagoCMS 3,但所有编辑弹出窗口都有烦人的问题。当页面内容大于(高于)浏览器窗口时会发生这种情况。当我尝试编辑文本或任何 cms 插件(双击内容)时,它会显示弹出窗口,但它的高度
我正在按照官方 Introductory Tutorial 创建一个带有 Django-Cms 的网站。我在前端的编辑模式上遇到了一些问题。首先,顶部横幅没有显示,占位符上的编辑菜单全部损坏。 我做的
我按照说明在我的 Mac 上安装了 Django CMS。当我运行“manage.py cms check”时,一切正常,只是它说找不到 template_1.html。当我进入管理员创建页面时,模板
我是 Django 的新手....经过几个小时的努力,我设法在虚拟环境中安装了 django cms。创建一些模板并将一些页面添加到我的 cms。现在我正在尝试添加一些 css....我已经创建了一个
运行 django-cms 2.4.0-RC1、django 1.5.1 和 python 2.7 的全新安装。我正在尝试使用单个字段创建一个非常简单的自定义插件。该插件在管理员中注册并且工作正常。它
我意识到 django-cms 的重点是没有内容类型并将所有内容都视为页面,但暂时忽略这一点,我将如何将它们添加到 django-cms 中?通过“内容类型”,我的意思是一些行为很像 Page 对象的
我按照说明在我的 Mac 上安装了 Django CMS。当我运行“manage.py cms check”时,一切正常,只是它说找不到 template_1.html。当我进入管理员创建页面时,模板
我正在为客户创建一个 django-cms 站点。我想做类似的事情: 想要的效果是有一个地方,CMS 的用户可以为页面选择背景图像。理想情况下,他们会选择使用类似 Filer 的现有图片。 . 有没
我们在 Django-CMS 中构建了一个网站,并开发了一个带有替代 CSS 的移动版本以适应较小的查看区域。除了通常的导航栏外,我们还希望在每个页面的底部包含下一页和上一页链接。 我知道如何使用这段
这是我在管理模式下尝试更改页面的高级设置时遇到的错误: TypeError at /admin/cms/page/5/advanced-settings/ __str__ returned non-s
我有一个 Orchard CMS 应用程序。我想在主页之外创建多个页面。我想在其他页面上显示一个菜单。用户登录时,应根据其角色显示菜单。有人可以给我解决方案吗? 最佳答案 您可以通过选择 在管理仪表板
如何在 Bolt 中列出分类法中的所有术语?不是应用于记录的术语而是所有现有术语(如标签云或类别列表侧边菜单)? 最佳答案 直接在模板中,可以这样做: {% for category in app.c
我正在构建一个非常简单的网络托管服务,以满足 ma 和 pa 类型的小型企业的需求。 现在我的两难选择是我应该从头开始构建它还是使用现有的 CMS。 CMS 需要可定制,因为我希望构建自己的客户端。我
我有文档类型产品,字段为:图像和文本。我想使用 CMS 转发器将 webpart 添加到 kentico,显示所有文档产品,但我想只显示包含图像的文档(不需要字段图像)。我添加了一行 WhereCon
我目前正在为我的个人项目开发一个非常基础的 CMS。这对我自己的教育和任何事情一样重要。我的一个问题是如何在没有文件扩展名的情况下实现 url/永久链接。我了解使用获取变量从数据库中提取数据,但是如何
Piranha 和 Vue 非常新,但不是 .Net Core。试图让我了解如何创建自定义块。我创建了一个新块,试图将 HtmlBlock 和 ImageBlock 结合起来: using Piran
我有两对不同的 CMS 和 CDS。一个在本地网络上,一个在公共(public)域上。我正在向本地网络上的 CMS 添加新的目标类型。此新目标类型的属性包含位于公共(public)域中的 CDS 的
我想使用一些基于 ASP.NET 的 CMS 来创建我的网站,但不知道该选择哪个... 我在 Sitefinity 中开始它,但是很难按照您想要的方式管理代码...并且它会生成 ASP.NET Web
我是一名优秀的程序员,十分优秀!