Fantomas42 / django-blog-zinnia

Simple yet powerful and really extendable application for managing a blog within your Django Web site.
http://django-blog-zinnia.com/
BSD 3-Clause "New" or "Revised" License
2.12k stars 730 forks source link

Entry detail URL not resolving #1

Closed alsoicode closed 14 years ago

alsoicode commented 14 years ago

After adding a new entry in admin, I get an exception:

TemplateSyntaxError at /admin/zinnia/entry/ Caught an exception while rendering: Reverse for 'zinnia_entry_detail' with arguments '()' and keyword arguments '{'year': '2010', 'slug': u'test-entry', 'day': '11', 'month': '05'}' not found.

My base urls.py for zinnia patterns is:

urlpatterns += patterns('', url(r'^comments/', include('django.contrib.comments.urls')), url(r'^feeds/', include('zinnia.urls.feeds')), url(r'^authors/', include('zinnia.urls.authors')), url(r'^categories/', include('zinnia.urls.categories')), url(r'^search/', include('zinnia.urls.search')), (r'^$', include('zinnia.urls')), )

Thoughts?

Fantomas42 commented 14 years ago

Maybe try to replace the last line by this : url(r'^$', include('zinnia.urls.entries')),

Fantomas42 commented 14 years ago

Ok fixed, configuration error.

KFNEXUS commented 14 years ago

Hello, i have the same problem like author of this topic. What i must to to defeat this?

Fantomas42 commented 14 years ago

Hello, can you paste me your project's urls.py ?

KFNEXUS commented 14 years ago

from django.conf.urls.defaults import * from django.contrib import admin from django.conf import settings

admin.autodiscover()

admin.site.root_path = "/admin/" # there is probably a bug in django...

urlpatterns = patterns('',

(r'^admin/(.*)', admin.site.root),

(r'^admin/', include(admin.site.urls)),
(r'^jsi18n/(?P<packages>\S+?)/$', 'django.views.i18n.javascript_catalog'),
(r'^categories/', include('categories.urls')),
# just for testing - native way to sampleapp urls 
(r'^sampleapp-native/', include('sampleapp.urls')),
url(r'^weblog/', include('zinnia.urls')),
url(r'^comments/', include('django.contrib.comments.urls')),

)

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

urlpatterns += patterns('', url(r'^', include('cms.urls')), )

Fantomas42 commented 14 years ago

Hum it seems weird... Are you sure that all the previous urls, are working ? Comment all the urls before zinnia's urls and tell me if it work.

fezick commented 13 years ago

I had this exact issue. I was running zinnia on a sub domain, and had a custom urlconf file that loaded zinnia.urls. Everything worked on site, but the admin exploded when I attempted to do anything with entries (the admin runs off the main url, while the site runs off the subdomain "blog").

To fix this, I had to add the following to the main sites urls.py file: url(r'^zinnia/', include('zinnia.urls')),