In this tutorial, we will discuss some important concepts in developing backend microservices with Django. We will see:

  1. How to build a professional CMS with wagtail.
  2. How to dockerize the project.
  3. How to properly set Production and Development environments.
  4. How to add features using Test Driven Development best practices.
  5. How to use docker-compose to properly connect different microservices to each other.
  6. How to generate fake data.
  7. Some best practices in Django, PostgreSQL, Nginx, Docker stack.

We are going to create a simple but powerfull CMS. This CMS can be used to provide content once, then automatically generate different outputs like…


This article is based on the previous one. You can easily follow along by cloning The Official EngineerX Github repository and change directory to part-5:

git clone https://github.com/HsnVahedi/EngineerX
cd EngineerX/backend/part-5

Overview

In part #6, We will define some blocks of data with wagtail’s StreamField. These general purpose blocks of data let us separate Content Providing from Content Representation: In other words, when someone provides some content, he doesn’t have to know anything about Web Development, Search Engine Optimization, Responsiveness and … This way, we can easily generate SEO-friendly web pages, Posts on Social Media and …

In part #6 we are…


This article is based on the previous one. You can easily follow along by cloning The Official EngineerX Github repository and change directory to part-4:

git clone https://github.com/HsnVahedi/EngineerX
cd EngineerX/backend/part-4

Overview

In previous chapters, We created a django project, dockerized it and set development and production environments. We also provided a few pieces of scripts which makes us able to easily generate fake users and images.

We haven’t added any new model or any new feature, yet.

In part #5 we will start developing this project by customizing django’s default User model. We are going to:

  1. Create a new User model…

This article is based on the previous one. You can easily follow along by cloning The Official EngineerX Github repository and change directory to part-3:

git clone https://github.com/HsnVahedi/EngineerX
cd EngineerX/backend/part-3

Overview

In the previous article, we have talked about the importance of being able to recreate data easily. We have also provided a mechanism for generating image objects.

In part #4, we will see how we can generate fake users and insert them in database.

Authentication and Authorization in Django and Wagtail:

Django provides django.contrib.auth which contains required models and tools for general authentication.

Wagtail also adds two new groups for authorization: Moderators and Editors.

Unlike ordinary users…


This article is based on the previous one. You can easily follow along by cloning The Official EngineerX Github repository and change directory to part-2:

git clone https://github.com/HsnVahedi/EngineerX
cd EngineerX/backend/part-2

Overview

In the previous article, we dockerized the application. Dockerizing an application makes us able to run it anywhere. We are guaranteed to always have exactly the same environment.

But what about data? Are we able to easily recreate our data?

Currently we don’t have any mechanism to programmatically insert objects into database.

Generating fake objects is the best solution. It can be useful in two places:

  1. generate data for tests: Normally you would like to initialize the database before running tests.
  2. Fill…

This article is based on the previous one.

Overview

In Part #2, we are going to touch briefly some important concepts in backend development with django. We are going to:

  1. Create a wagtail project.
  2. “Dockerize” the project and set development and production environments.
  3. See an example of writing optimized dockerfiles.
  4. Learn how to connect different microservices to start the production environment using docker-compose.
  5. learn how to make a microservice wait for another one to be available using wait-for-it.
  6. Learn how to serve files using Nginx.

Introduction to Django web framework (Skip if you are already familiar with django)

If you care about backend development, you’ve probably heard about Django:

The web framework for perfectionists…

Hossein Vahedi

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store