djangozinnia

Not able to add new category to zinnia in Admin


I have installed zinnia on my website and everything works fine, except that I can not add a new category in the admin. When I click on "Add Category" in admin, it takes me to the homepage of my website.

I am using Django 1.6 and Zinnia 0.14 versions. As I have a custom user model in my app, I have made changes to few templates as per issues

https://github.com/Fantomas42/django-blog-zinnia/issues/323

https://github.com/Fantomas42/django-blog-zinnia/commit/4c9809f98b48254d03173432e09d88074f660316

After making the above changes, I can add a new entry in the admin but I can not add a new category in the admin interface and it takes to my homepage when i click on 'Add Category' (url is admin/zinnia/category/add) button.

Any ideas on what I am missing ?

Thanks


Solution

  • I have managed to find what the problems is. The problem lies in the order my urls's are defined.

    My app has below urls defined in the urlpatterns

    url(r'category/(?P[-\w]+)/$', 'individual_item_page', name='individual_item_page''),
    

    and if I put the above url before the zinnia url

    url(r'^blog/', include('zinnia.urls')),
    

    then when i click on "Add Category" (admin/zinnia/category/add) on zinnia category list in admin, it is going to the view individual_item_page instead of zinnia one's. Not sure why it is calling my app view rather than zinnia views.

    I changed the order of urls by putting zinnia urls before my custom urls and it works fine.