No reverse match for 'zinnia_entry_add' after rewriting entry’s URL

78 views Asked by At

I am running Django 1.10.6, Django-cms 3.4.2, Django-blog-zinnia 0.18.1 and cmsplugin-zinnia==0.8.1 (downloaded from github fork, where django 1.10 compatibility is implemented)

I'm stuck with this problem for too long and by brain is melting

I've done everything like the manual says

I created a custom app zinnia_integration in my project:

zinnia_integration/models.py

from django.db import models
from zinnia.models_bases.entry import AbstractEntry

class EntryWithNewUrl(AbstractEntry):
    """Entry with '/blog/<slug>/' URL"""

    @models.permalink
    def get_absolute_url(self):
    return ('zinnia:entry_detail', (),
            {'slug': self.slug})

    class Meta(AbstractEntry.Meta):
        abstract = True

zinnia_integration/views.py

from django.views.generic.detail import DetailView
from zinnia.models.entry import Entry
from zinnia.views.mixins.entry_preview import EntryPreviewMixin
from zinnia.views.mixins.entry_protection import EntryProtectionMixin

class EntryDetail(EntryPreviewMixin,
                  EntryProtectionMixin,
                  DetailView):
    queryset = Entry.published.on_site()
    template_name_field = 'template'

zinnia_integration/urls.py

from django.conf.urls import url
from zinnia_integration.views import EntryDetail

urlpatterns = [
    url(r'^(?P<slug>[-\w]+)/$',
        EntryDetail.as_view(),
        name='entry_detail'),
]

And I include this urlpatterns in my project's urls.py

blog_urls = ([
    ...
    url(r'^blog/comments/', include('zinnia.urls.comments')),
    url(r'^blog/', include('zinnia_integration.urls')),
    #url(r'^blog/', include('zinnia.urls.entries')),
    url(r'^blog/', include('zinnia.urls.archives')),
    ....
], 'zinnia')

urlpatterns = [
    ...
    url(r'^', include(blog_urls)),
    ...
]

and in my settings.py

ZINNIA_ENTRY_BASE_MODEL = 'zinnia_integration.models.EntryWithNewUrl'

After that, I restart my server and get the

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

Even if I don't change anything in subclass model (EntryWithNewUrl) I still get the error!

0

There are 0 answers