I have a django-cms project containing an application called core. Inside the kernel, I created the file "cms_app.py" as follows:
# -*- coding: utf8 -*- from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ class CoreApphook(CMSApp): name = _(u"Core Apphook") urls = ["core.urls"] apphook_pool.register(CoreApphook)
In my /urls.py kernel, I have the following code:
# -*- coding: utf8 -*- from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('', # URLS refrentes ao apphook CoreApphook url(r'^$', 'noticia.views.ultimas_noticias'), url(r'^noticias/$', 'noticia.views.ultimas_noticias'), url(r'^noticias/(?P<categoria>[\w\d-]+)/$', 'noticia.views.noticias_categoria'), url(r'^noticias/(?P<categoria>[\w\d-]+)/(?P<pagina>\d+)/$', 'noticia.views.noticias_categoria_paginated'), url(r'^noticias/(?P<categoria>[\w\d-]+)/(?P<subcategoria>[\w\d-]+)/(?P<titulo>[\w\d-]+)/$', 'noticia.views.noticia'), url(r'^paginacao/noticias/$', 'noticia.views.noticias_categoria_paginated'), )
I am trying to achieve this view:
url(r'^noticias/(?P<categoria>[\w\d-]+)/(?P<subcategoria>[\w\d-]+)/(?P<titulo>[\w\d-]+)/$', 'noticia.views.noticia'),
Using this URL:
http://127.0.0.1:8000/noticias/filmes/acao/lol-e-poka-zuera/
But urls.py is not loading Apphook. I have already set the Apphook field on each child page of "Noticias" and "Noticias". The strange thing is that I have the same structure in another project that works great. And, obviously, I installed the "core" application in INSTALLED_APPS. I just can't imagine what might cause this problem. I used a breakpoint in my kernel /urls.py, but was not called by Apphook.