Projects Plaza

how-to-create-bar-chart-with-matplotlib-and-django-3

How to create Bar Chart image with Matplotlib in Django

Hello World, Welcome to projectsplaza.com. Today I am going to discuss how to create a bar chart image with the Matplotlib in Django 3. We will create a bar chart according to data and save a png image and then display this image in the Django template. I have divided this tutorial into the following parts:

  • Matplotlib introduction
  • Install Matplotlib
  • Create a bar chart view method
  • Show bar chart in the template view

Read More »How to create Bar Chart image with Matplotlib in Django

How to share common data in all Django templates

Hello World, Welcome to ProjectsPlaza.com. Today I am going to discuss how to share common data in all Django templates. In this tutorial, we will show common data in all templates with the help of a context processor.
According to the official documentation:
context_processors is a list of dotted Python paths to callables that are used to populate the context when a template is rendered with a request. These callables take a request object as their argument and return a dictionary of items to be merged into the context.

We will create a very simple example. In this example, we will create some view methods and their relative template. Then we will pass dictionary data to context processor and show in all templates.
I have assumed that you have basic knowledge of Django. If you are new to Django then please see our beginner tutorials.
I have divided this tutorial into the following steps:
  • Create shareData app and add to project
  • Create two view method index and show with their relative HTML templates
  • Create a URL and add to the project to show the template view
  • Create a third view method to pass data in a context processor
  • Access the data in both templates

Read More »How to share common data in all Django templates

add-and-update-data-with-django-model-form

Add and update data with Model Form in django 3

Hello World, Welcome to ProjectsPlaza.com. Today I am going to discuss how to add and update data with ModelForm in Django 3. In this tutorial, We will create a simple todo application with add, update, and delete functionality. I have divided this tutorial into the following steps:

  • Create a learning project
  • Create todo app
  • Create todo Model
  • Create add and update form from todo model
  • Delete todo item
  • Add bootstrap 4 in the templates

This is a small but full-fledged application built with Django 3 and bootstrap 4. You can download source code from GitHub.

Read More »Add and update data with Model Form in django 3

how-to-upload-image-in-django

How to upload image in django

Hello World, Welcome to ProjectPlaza.com. Today we will discuss how to upload image in Django. We will create a simple form to upload a single image. We will upload an image with Django core FileSystemStorage package.  I have divided this tutorial into the following parts:

I have assumed that you have basic knowledge of Django. If not then please see this tutorial.

  • Path setting for upload folder
  • Create upload form
  • Upload Image

Read More »How to upload image in django

how-to-create-search-option-in-django-3

How to create search field in django admin

Hello World, Welcome to ProjectsPlaza.com. Today we will discuss how to create a search field in the Django admin panel. I am using Django 3. Django is a very powerful MVT (Model View Template) web Framework built with python. It comes with lots of features.

For creating a search option in the Django admin panel, We just need to activate the search features. If you have not created an admin panel in Django then please have a look at the following tutorial 👇.

How to create an admin panel in Django 3

Read More »How to create search field in django admin

use-annotate-aggrgation-in-django

How to use annotate aggregation in django

Hello World, Welcome to ProjectsPlaza.com. Today we will discuss how to use annotate aggregation in Django. In this tutorial, we will fetch data from two different models. For example, I am creating a video sharing website like YouTube. I have two models. One is a channel and another is a video. Both models are joined with foreign keys. Now I want to fetch channels with videos count. I will do this with annotate aggregation.

Read More »How to use annotate aggregation in django