nephila / djangocms-blog

django CMS blog application - Support for multilingual posts, placeholders, social network meta tags and configurable apphooks
https://djangocms-blog.readthedocs.io
BSD 3-Clause "New" or "Revised" License
403 stars 190 forks source link

NoReverseMatch: u'djangocms_blog' is not a registered namespace, error in get_absolute_url in Post #41

Closed viatoriche closed 10 years ago

viatoriche commented 10 years ago
Environment:

Request Method: GET
Request URL: http://0.0.0.0:8000/ru/blog/?edit_off

Django Version: 1.6.5
Python Version: 2.7.6
Installed Applications:
('admin_tools',
 'admin_tools.theming',
 'admin_tools.menu',
 'admin_tools.dashboard',
 'djangocms_text_ckeditor',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.sites',
 'django.contrib.sitemaps',
 'django.contrib.staticfiles',
 'django.contrib.messages',
 'cms',
 'mptt',
 'menus',
 'south',
 'sekizai',
 'djangocms_style',
 'djangocms_column',
 'djangocms_file',
 'djangocms_flash',
 'djangocms_googlemap',
 'djangocms_inherit',
 'djangocms_link',
 'djangocms_picture',
 'djangocms_teaser',
 'djangocms_video',
 'reversion',
 'main',
 'crashreport',
 'lottery',
 'subscribe',
 'social_auth',
 'taggit',
 'taggit_autosuggest',
 'filer',
 'easy_thumbnails',
 'hvad',
 'django_select2',
 'cmsplugin_filer_image',
 'parler',
 'cmsplugin_filer_file',
 'cmsplugin_filer_folder',
 'cmsplugin_filer_link',
 'cmsplugin_filer_video',
 'cmsplugin_filer_teaser',
 'cmsplugin_filer_utils',
 'meta',
 'meta_mixin',
 'admin_enhancer',
 'djangocms_blog',
 'registration',
 'registration_email')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware',
 'cms.middleware.language.LanguageCookieMiddleware')

Template error:
In template /home/viator/coding/PreppyLLC/web/apps/djangocms_blog/templates/djangocms_blog/includes/blog_item.html, error at line 6
   u'djangocms_blog' is not a registered namespace
   1 : {% load i18n thumbnail cms_tags %}

   2 : {% load url from future %}

   3 : 

   4 : <article id="post-{{ post.slug }}" class="post-item">

   5 :     <header>

   6 :         <h3><a href=" {{ post.get_absolute_url }} ">{{ post.title }}</a></h3>

   7 :      {% block blog_meta %}

   8 :             <ul class="post-detail">

   9 :                 <li>

   10 :                     {% trans "by" %} <a href="{% url 'djangocms_blog:posts-author' post.author.username %}">{{ post.author.get_full_name }}</a>

   11 :                 </li>

   12 :                 <li>

   13 :                     {{ post.date_published|date:"M d, Y" }}

   14 :                 </li>

   15 :             </ul>

   16 :             <ul class="post-detail tags">

Traceback:
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  137.                 response = response.render()
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/response.py" in render
  105.             self.content = self.rendered_content
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/response.py" in rendered_content
  82.         content = template.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  140.             return self._render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  123.         return compiled_parent._render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  123.         return compiled_parent._render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/classytags/core.py" in render
  106.         return self.render_tag(context, **kwargs)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/sekizai/templatetags/sekizai_tags.py" in render_tag
  76.         rendered_contents = nodelist.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/classytags/core.py" in render
  106.         return self.render_tag(context, **kwargs)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in render_tag
  667.         rendered_contents = nodelist.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  62.             result = block.nodelist.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  62.             result = block.nodelist.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  196.                         nodelist.append(node.render(context))
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  155.         return self.render_template(self.template, context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render_template
  137.         output = template.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  140.             return self._render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/debug.py" in render
  88.             output = self.filter_expression.resolve(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in resolve
  585.                 obj = self.var.resolve(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in resolve
  735.             value = self._resolve_lookup(context)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/template/base.py" in _resolve_lookup
  789.                             current = current()
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/utils/functional.py" in _curried
  15.         return _curried_func(*(args + moreargs), **dict(kwargs, **morekwargs))
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/db/models/base.py" in get_absolute_url
  1009.     return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label, opts.model_name), func)(self, *args, **kwargs)
File "/home/viator/coding/PreppyLLC/web/apps/djangocms_blog/models.py" in get_absolute_url
  179.         return reverse('djangocms_blog:post-detail', kwargs=kwargs)
File "/home/viator/coding/PreppyLLC/env/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in reverse
  528.                                          key)

Exception Type: NoReverseMatch at /ru/blog/
Exception Value: u'djangocms_blog' is not a registered namespace
viatoriche commented 10 years ago

Need restart and add blog as CMS application for work

mradochonski commented 9 years ago

@viatoriche I have djangocms_blog in installed apps and still getting the same error. Unless you ment something else.

christianwgd commented 9 years ago

I had the same Problem. Adding the blog application to the page helped in some cases, but then i couldn't use the blog as a placeholder in my other templates (without assigning the page to the blog app). I ended up adding the following line to my urls.py: url(r'djangocms_blog/', include('djangocms_blog.urls', namespace='djangocms_blog')), Maybe it would be a good idea to add this to the configuration docs or maybe i'm completely wrong?

yakky commented 9 years ago

The correct process to attach the blog to the urlconf is documented in the last step of the Quick Hint: https://github.com/nephila/djangocms-blog#quick-hint Using the apphok it's by far the recommended method to use any djangocms-enabled application