Django for Beginners: Build websites with Python and Django by Vincent William S

Django for Beginners: Build websites with Python and Django by Vincent William S

Author:Vincent, William S.
Language: eng
Format: epub
Publisher: leanpub.com
Published: 2018-02-21T16:00:00+00:00


Delete View

The process for creating a form to delete blog posts is very similar to that for updating a post. We’ll use yet another generic class-based view, DeleteView, to help and need to create a view, url, and template for the functionality.

Let’s start by adding a link to delete blog posts on our individual blog page, post_detail.html.

Code

<!-- templates/post_detail.html -->

{% extends 'base.html' %}

{% block content %}

<div class="post-entry">

<h2>{{ object.title }}</h2>

<p>{{ object.body }}</p>

</div>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.