pythondjangooverridingdjango-cmszinnia

django cms and zinnia skeleton override


I am trying to connect zinnia to django-cms 3.0

I have launched zinnia and it works just fine. Now I am trying to start changing styles. More specifically templates/zinnia/skeleton.html override.

Once I add template to override original template - url reverse starts on failing.

NoReverseMatch at /en-us/blog/
Reverse for 'entry_archive_index' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

All of the urls use namespace as in {% url 'zinnia:entry_archive_index' %} and yet reverse in shell also just fails.

What else could be done to debug it? Maybe it's because of localization?

I have urls config:

from django.conf.urls import patterns, url, include
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.conf import settings

admin.autodiscover()

urlpatterns = i18n_patterns(
    '',
    url(r'^admin/', include(admin.site.urls)),
    url(r'^blog/', include('zinnia.urls', namespace='zinnia')),
    url(r'^comments/', include('django.contrib.comments.urls')),
    url(r'^tinymce/', include('tinymce.urls')),
    url(r'^', include('cms.urls')),
)

if settings.DEBUG:
    urlpatterns = patterns(
        '',
        url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
            {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
        url(r'', include('django.contrib.staticfiles.urls')),
    ) + urlpatterns

Settings:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.admin',
    'django.contrib.sites',
    'django.contrib.comments',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.contenttypes',
    'my_main_django_cms_app',
    'cms',
    'mptt',
    'menus',
    'south',
    'sekizai',
    'djangocms_text_ckeditor',
    'djangocms_picture',
    'djangocms_inherit',
    'djangocms_googlemap',
    'cmsplugin_contact',

    'tinymce',
    'tagging',
    'zinnia_threaded_comments',
    'zinnia',
    'cmsplugin_zinnia',
)

And my_main_django_cms_app structure is

.
├── cms_plugins.py
├── forms.py
├── __init__.py
├── manage.py
├── models.py
├── settings.py
├── static
├── templates
│   ├── base.html
│   ├── home.html
│   └── zinnia
│       └── skeleton.html
├── urls.py
├── wsgi.py

And my versions:

Django==1.6.5
Pillow==2.4.0
South==0.8.4
argparse==1.2.1
beautifulsoup4==4.3.2
cmsplugin-contact==1.0.0
cmsplugin-zinnia==0.6
django-app-namespace-template-loader==0.1
django-blog-zinnia==0.14.1
django-classy-tags==0.5.1
django-cms==3.0
django-mptt==0.6.0
django-reversion==1.8.1
django-sekizai==0.7
django-tagging==0.3.2
django-tinymce==1.5.2
django-xmlrpc==0.1.5
djangocms-admin-style==0.2.2
djangocms-googlemap==0.0.5
djangocms-inherit==0.0.1
djangocms-picture==0.0.2
djangocms-text-ckeditor==2.1.6
gevent==1.0.1
greenlet==0.4.2
gunicorn==19.0.0
my_main_django_cms_app==0.1
html5lib==1.0b3
ipdb==0.8
ipython==2.1.0
psycopg2==2.5
pyparsing==2.0.2
pytz==2014.4
six==1.7.2
wsgiref==0.1.2
zinnia-threaded-comments==0.2

Solution

  • I have been trying to integrate zinnia into django cms for a few days, and here's my experience, which gets me to the point where I can use my own django cms template for zinnia, but I'm still not getting the menus provided with cmsplugin_zinnia to work.

    Compared to your setup, I've made the following changes:

    With this, I can select Zinnia Weblog as Application under Advanced Settings for a new Django CMS page, and give it a unique Application Instance Name as suggested in the Django CMS docs. The name of the page or its url/slug field don't matter.

    From here I can come up with my own skeleton.html that makes no reference to zinnia whatsoever, and have zinnia.base.html extend my new skeleton template.

    However, at this point the cmsplugin_zinnia docs suggest:

    but instead I get a NoReverseMatch at /name_of_my_blog_app/ exception, which only disappears if I include the zinnia.urls as above without namespace.

    As a few weeks have passed since your original post, you may have resolved this by now. If not, I hope this points you into the right direction. In case you ran into the same issues (EntryMenu not loaded) at some point and were able to resolve, please let me know.