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
- Create a new directory for our code called Blog.
- Install Django in a new virtual environment.
- Create a new Django project called blog_project .
- Create a new app called blog.
- Perform a migration to set up database.
- 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