Coder Social home page Coder Social logo

joelwembo / django-multitenant-saas-ecommerce-kubernetes Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 25.0 33.11 MB

Django Multi-tenant , microservices , Kubernetes, Jenkins, Github Actions and Multiple Databases using docker, bash, postgres, terraform, Redis, celery and AWS API Gateway.

Home Page: https://medium.com/django-unleashed/technical-guide-end-to-end-ci-cd-devops-with-jenkins-docker-kubernetes-argocd-github-actions-fee466fe949e

Dockerfile 0.09% Python 19.65% Shell 1.72% CSS 35.13% JavaScript 1.67% SCSS 39.46% HTML 1.22% HCL 0.81% Makefile 0.24% Procfile 0.01%
aws django django-rest-framework ansible github-actions jenkins postgres python

django-multitenant-saas-ecommerce-kubernetes's Introduction

Django-multitenant-saas-ecommerce-project

Automating Django , Celery , Redis and postgres deployment to AWS EC2 using Terraform ( Complete Guide)

image

Introduction

Automating deployment processes is crucial for modern web development, enhancing productivity and reliability. In this article, we focus on automating the deployment of a Django web application onto an Ubuntu Server hosted on AWS EC2.

Prerequisites:

Before we get into the good stuffs, first we need to make sure we have the required services on our local machine or dev server, which are:

  • Basic knowledge of Django
  • AWS Account
  • Github Account
  • AWS CLI installed and configured.
  • ECS CLI
  • Docker installed locally.
  • Typescript installed
  • Postman
  • Python 3
  • NPM
  • NodeJS
  • Terraform
  • A Domain name Hosted from any domain name provider ( Ex: AWS Route 53 )
  • Basic familiarity with YAML and GitHub workflows.
  • A Django project hosted in a GitHub repository
  • Basic knowledge of HTML or React
  • Any Browser for testing
  • Intermediate knowledge in Serverless Computing ( Ex : AWS Lambda , ECS,..)

You can follow along with this source code: GitHub - joelwembo/django-multitenant-saas-ecommerce-kubernetes: Django Multi-tenant … Django Multi-tenant , microservices , Kubernetes, Jenkins, Github Actions and Multiple Databases using docker, bash… github.com

Steps

Step 1: Create a virtual environment to hold all pip libraries installations

If you don’t have virtualenv installed, you can install it by running the following command in your CMD after Python was installed:

Create virtual environment for Python python3 -m venv .venv

Step 2 : Activate the environment:

source ./venv/bin/activate
source ./venv/bin/deactivate ( To Deactivate )

Step 3: Create project folder

mkdir app

Step 4: Install Django

pip install django

Step 5: Create a new Django project inside the project folder

A Django app is a self-contained component of a Django project. It is a module that provides specific functionality, such as handling authentication, managing blog posts, or serving an API. An app should represent a single, specific functionality or purpose within the overall website.

django-admin startproject django-multitenant-saas-ecommerce-kubernetes

Step 6: Create a new test app:

within the django project using the following command:

python manage.py startapp testapp

Adding a new app into the project

python manage.py startapp home apps/home

Step 7 : Execute ORM Data Migrations:

python manage.py makemigrations
python manage.py migrate

Step 8: Launch the django development server

python manage.py runserver

Step 9: create admin user

python manage.py createsuperuser

start using shell

bash ./server-entrypoint.sh

Docker

bash ./run.sh
http://127.0.0.1:8585/

API Docs

http://127.0.0.1:8585/swagger/

@Swagger

Data Browser

http://127.0.0.1:8585/data-browser/ image

GraphQL

Alt text http://127.0.0.1:8585/graphql

Extensions

python manage.py show_urls python manage.py graph_models finances -a -o finances_models.png

wagtail

Django ledger

pip install pipenv (globally)

To activate this project's virtualenv, run pipenv shell. Alternatively, run a command inside the virtualenv with pipenv run.

pipenv install django-ledger[graphql,pdf]
python manage.py test django_ledger

Multi tenant Settings

pip install -r requirements.txt
python manage.py makemigrations finances
python manage.py makemigrations app
python manage.py migrate finances
python manage.py migrate app

tenant = Client(schema_name="test", name="test Company")

domain = Domain(domain="btest.localhost", tenant=tenant, is_primary=True)

Thank you for Reading !! 🙌🏻, see you in the next article.🤘

For more information about the author visit

django-multitenant-saas-ecommerce-kubernetes's People

Contributors

joelwembo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.