When you start adding content to your blog, you will soon realize you need to split the list of posts across several pages. Django has a built-in pagination class that allows you to manage paginated data easily.
Now that We have created views and URL patterns for the blog application. It's time to create the HTML templates to display posts in a user-friendly manner. The render() function looks for HTML templates inside a directory called templates inside your app directory.
A Django view is just a Python function that receives a web request and returns a web response. All the logic to return the desired response goes inside the view. First, we will create our application views, then we will define a URL pattern for each view, and finally, we …
Now that you have a fully functional administration site to manage your blog's content, it's time to learn how to retrieve information from the database and interact with it. Django comes with a powerful database abstraction API that lets you create, retrieve, update, and delete objects easily. The Django Object-relational …
Now that we have defined the Post model, we will create a simple administration site to manage your blog posts. Django comes with a built-in administration interface that is very useful for editing content. The Django admin site is built dynamically by reading your model metadata and providing a production-ready …