diegoug / django-microservices

Using Django one of the most powerful backends to orchestrate a system based on microservices, where Django becomes the cornerstone.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django Microservices

Based on Django REST framework + OAuth project

Configuring Django to work on a many Djangos in a microsevices architecture

Index

Dependencies

Linux

To start to work with docker, we need install docker and docker composer as a primary step, in versions that can work with the YAML compose configuration file in version two.

Windows

First, to use docker in windows you must have windows 10 pro or higher, but always pro, or windows server or enterprise. Next, is to download and install the docker installer (https://docs.docker.com/docker-for-windows/install/).

Make sure you install the linux containers.

After is installed, from the Windows PowerShell, we test with the following command and should receive the version of docker:

docker --version

Cygwing

cygwin is a Linux-like open source project package manager for use on windows.

Now, to be able to use the make command and the other regular commands such as cp, pwd etc, we install Cygwin that can be download from (a terminal with the linux functions but on windows):

NOTE 1: In the configuration and downloading page search and select the make command with changing skip option to the version required that is '4.3-1' and should look like the following:

Make install with cygwin

NOTE 2: In case the commands installed are shwon in the bin folder but can not be called from bash or mintty we need to add the route to the bin folder, where are located the commands, and include in the PATH variable of the system.

NOTE 3: In case you need to install another package using Cygwing it is necessary to run the setup again to show you the package manager.

NOTE 4: To use the Cygwin terminal in VSCode it is necessary to have the following configuration in the settings.json

{
    "editor.rulers": [79, 90],
    "terminal.integrated.shell.windows": "C:\\cygwin64\\bin\\bash.exe",
    "terminal.integrated.env.windows": {
        "CHERE_INVOKING": "1"
    },
    "terminal.integrated.shellArgs.windows": [
        "--login",
        "-i"
    ],
    "explorer.confirmDelete": false,
    "explorer.confirmDragAndDrop": false,
}

Option 2 (Not Recommended)

Now, to install the make command, that is the main command used in windows we have to download and install Chocolatey (https://chocolatey.org/install) through the following command in the Windows PowerShell as admin mode:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

we should see something like the following:

Chocolatey install

After is installed chocolatey, we proceed to install the make command running the following instruction:

choco install make

we should see something like the following:

Make install

Also is needed the docker-compose command that is installed through:

choco install docker-compose

we should see something like the following:

Docker-compose install

NOTE: select your system operative for download version of docker.

Key SSH

Linux SSH

First step is generate a new ssh key in the next link we found the steps to follow for the new ssh key:

Now we going to configurate our ssh key, with our logged in user go to the following link:

in the following link we find the steps to copy our ssh and configure it in the previous link view:

Download main repository

Linux Repository

to download the repository, only need run the next command:

git clone git@github.com:diegoug/

Windows Repository

Incase of windows is recommended to donwload and install GitHub desktop that allows you to select and manage the sync from local to/from the repository, it can be downloaded from:

And is require only to login as in the web page.

commands to work with docker

Now we need run the next commands in order.

create the network

$ make create-network

NOTE: In case and error appears like 'docker could not find plugin bridge in v1 plugin registry: plugin not found' the solution can be done by using the command: docker network create --driver nat ntwk-mnto

Install dependencies

$ make build-development

Start development

$ make start-development

Stop development

$ make stop-development

About

Using Django one of the most powerful backends to orchestrate a system based on microservices, where Django becomes the cornerstone.


Languages

Language:Python 87.3%Language:Dockerfile 6.7%Language:HTML 2.6%Language:Makefile 2.4%Language:Shell 1.0%