I have an app called CMS with Category and Article. Quite simple.
I overwrite app_index.html
to enable ajax-based drag-n-drop ordering and to move articles from one category to another.
Now I would like to redirect after saving/deleting an article or a category to cms' app_index.html
instead of the model's change_list.html
. How can this be done?
Thanks
class Category(models.Model):
order = models.IntegerField()
title = models.CharField(max_length=100)
text = models.TextField()
class Article(models.Model):
published = models.BooleanField(default=None)
images = generic.GenericRelation(Photo)
category = models.ForeignKey(Category)
title = models.CharField(max_length=100)
text = models.TextField()
order = models.IntegerField(blank = True, null = True)
Edit
No, my own answer didn't work. I misunderstood the redirect app
Edit 2
Daniel's answer did half the job: Redirect after changing the articles and categories.
Edit 3
A not very elegant solution: Redirection in urls.py
def redirect_cms(response):
return HttpResponseRedirect('/admin/cms/')
urlpatterns += patterns('',
(r'^admin/cms/article/$',redirect_cms),
any other idea?