В моделях прописано:
class Article(models.Model):
#....
def get_absolute_url(self):
return reverse('detail', kwargs={'id': self.id})
Далее views
class ArticleCreateView(View):
def post(self, request):
bound_form = ArticleForm(request.POST)
if bound_form.is_valid():
new_article = bound_form.save()
return redirect(new_article) # ЗДЕСЬ ОШИБКА
return render(request, 'blogapp/article_create.html', {'form': bound_form})
Ошибка такая:
NoReverseMatch at /create/
Reverse for 'detail' with keyword arguments '{'id': 16}' not found. 1 pattern(s) tried: ['(?P[0-9]+)/$']