Artificial Intelligence Design Health Innovation Machine Learning Software Tech/Gadgets Technology Tips/How-tos

Building And Implementing A Blog App Using The Django Framework

Pinterest LinkedIn Tumblr

Introduction

In this article, we shall learn how to build and implement a blog app. A blog app that allows users to create, edit and delete posts. The homepage of our blog app should be able to list all blog posts and there will also be a dedicated detailed page for each blog posts. In this article, we shall also introduce CSS for styling and learn how Django works with static files.

Our Initial Setup

  1. Create a new directory for our code called Blog.
  2. Install Django in a new virtual environment.
  3. Create a new Django project called blog_project .
  4. Create a new app called blog.
  5. Perform a migration to set up database.
  6. Update settings.py.

To do this, open your project in the command prompt and input the following:

mkdir blog && cd blog

pipenv install django==3.0.1

pipenv shell

django_admin startproject blog_project .

python manage.py startapp blog

python manage.py migrate

python manage.py runserver

ALSO READ  Blue Bubbles VS Green Bubbles: Explained!