How to convert AWS .pem key to putty .ppk key

Here I have AWS key .pem , to connect with putty in windows we need the .ppk format ,so here i have to convert AWS .pem key to putty .ppk key ,in simple have to convert .pem to .ppk

How convert AWS .pem key to putty .ppk key for that we have lots of software available, here am going to show with the help of  PuTTYgen

1 Download .pem (Privacy Enhanced Mail) from  AWS , is a base64 container format for encoding keys and certificates


2 ) Download PuTTYgen from online and install


3) Open PuTTYgen

convert AWS .pem key to putty .ppk key

4) Click Load button and load the .pem files

convert AWS .pem key to putty .ppk key

5) Click “save private key ” button and save your ppk files

so you converted AWS .pem key to Putty Private Key(ppk) or in simple .pem to .ppk

How to setup two domain using Lamp or XAMPP AWS Linux 2

Suppose we need to create two domain with xampp Let say and

First we have to install xampp in your AWS Linux 2  see below link for that

How to install xampp and FTP in AWS Linux 2 server

Then folle below steps

1 Allow custom virtual hosts from Apache config

open Apache config file using below command

# vi /opt/lampp/etc/httpd.conf


Find out below code
# Virtual hosts
#Include etc/extra/httpd-vhosts.conf

Replace above code with 

# Virtual hosts
Include etc/extra/httpd-vhosts.conf


2) Add custom domain in the hosts file

#vi /etc/hosts

3) Add custom domain in the hosts file

#vi /etc/hosts
add this two host at the end

4) Create your virtual hosts

#vi /opt/lampp/etc/extra/httpd-vhosts.conf

Add below line at the end

 DocumentRoot "/opt/lampp/htdocs/tutorialshore"
 DirectoryIndex index.php

 <Directory "/opt/lampp/htdocs/tutorialshore">
 Options All
 AllowOverride All
 Require all granted

 DocumentRoot "/opt/lampp/htdocs/viewshore"
 DirectoryIndex index.php

 <Directory "/opt/lampp/htdocs/viewshore">
 Options All
 AllowOverride All
 Require all granted

5) Create project Directoty

#cd /opt/lampp/htdocs
#mkdir tutorialshore
#mkdir viewshore

6) Upload your files and enjoy with your two new website

Creating a python application from scratch

  1.  Install Django

!) pip install “django>=2.1,<2.2”

!!) django-admin startproject metro

!!!)  python startapp metroshop

!v) python runserver

v) python createsuperuser


  • Change Metro Project add Metroshop













        'BACKEND': 'django.template.backends.django.DjangoTemplates',

        'DIRS': [os.path.join(BASE_DIR, 'templates')],

        'APP_DIRS': True,

        'OPTIONS': {

            'context_processors': [










WSGI_APPLICATION = 'metro.wsgi.application'



# Database




    'default': {

        'ENGINE': 'django.db.backends.sqlite3',

        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),





# Password validation





        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',



        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',



        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',



        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',




  • Metro Project add Metroshop app URL


from django.contrib import admin

from django.urls import path, include

from django.urls import path


urlpatterns = [


    path('', include('metroshop.urls')),

 path('metroshop/', include('metroshop.urls')),



  • Create inside meroshop folder
    from django.urls import path from . import views   urlpatterns = [     path('', views.index, name='index'),     path('master_config', views.master_config, name='master_config'),     path('master_config_update', views.master_config_update, name='master_config_update'),   ]


  • Update files with new view functions



from django.shortcuts import render, get_object_or_404

from django.http import HttpResponseRedirect

from .models import  Master_config


from django.urls import reverse

from django.utils import timezone

from django.contrib.auth.decorators import login_required

from django.http import HttpResponse

import json


# Create your views here.


def index(request):


    #return render(request, 'metroshop/test.html')


    return render(request, 'metroshop/salesbill.html')


def master_config(request):


    m_config =  Master_config.objects.filter()


    return render(request, 'metroshop/master_config.html', {'m_config': m_config})


def master_config_update(request):

    company_name = request.POST['company_name']

    company_mobile = request.POST['company_mobile']

    company_address = request.POST['company_address']

    company_code = 1

    a = Master_config(company_code=company_code,company_name=company_name,company_mobile=company_mobile,company_address=company_address)


    m_config = Master_config.objects.filter()


    return render(request, 'metroshop/master_config.html', {'m_config': m_config})

  • define new model
  from django.db import models import math from django.core.validators import MinValueValidator, MaxValueValidator from django.contrib.auth.models import AbstractUser from django.db.models.signals import post_save, post_delete from datetime import timedelta, date   # Create your models here. class Master_config(models.Model):       company_code = models.CharField(primary_key='True', max_length=100)     company_name = models.CharField(max_length=200)     company_mobile = models.CharField(max_length=200)     company_address = models.CharField(max_length=100)       def __str__(self):         return self.company_code


  • Create templates/metroshop/base.html
<!DOCTYPE html>

<html lang="en">



    <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <meta name="description" content="">

    <meta name="author" content="">


    <title>{% block title %}{% endblock %}</title>

    {% load static %}


       <!-- Bootstrap core CSS -->

       <link href="{% static '/metroshop/homepage/vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">

       <link href="{% static '/metroshop/css/style.css' %}" rel="stylesheet">

     <!-- Custom styles for this template-->

     <link href="{% static '/metroshop/bootstrap/css/sb-admin.css' %}" rel="stylesheet">


     <!-- Custom styles for this template -->



    <link rel="stylesheet" href="" type="text/css" media="all" />



    <script src=""></script>

    <script src="" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>


    <link href="" rel="Stylesheet"></link>

   <script src="" ></script>




  <body id="page-top">


    <nav class="navbar navbar-expand navbar-dark bg-dark static-top">


      <a class="navbar-brand mr-1" href="{% url 'index' %}">Metro ERP</a>


      <button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">

        <i class="fas fa-bars"></i>



      <!-- Navbar -->

        <div class="collapse navbar-collapse" id="navbarResponsive">


          <ul class="navbar-nav ml-auto">

            <li class="nav-item">

                {% if request.user.is_student %}

                    <a class="nav-link text-capitalize">{{ }}</a>

                {% elif request.user.is_teacher %}

                    <a class="nav-link text-capitalize">{{ }}</a>

                {% endif %}


            <li class="nav-item">

                <a class="nav-link" href="#" data-toggle="modal" data-target="#logoutModal">Logout</a>







    <div id="wrapper">


      <!-- Sidebar -->

      <ul id="nav" class="sidebar navbar-nav">


        <li class="nav-item">

          <a class="nav-link" href="{% url 'index' %}">




        <li><a href="#" class="sub" tabindex="1">Master</a><img src="{% static 'metroshop/images/up.gif' %}"  alt="" />


            <li><a  href="{% url 'master_config' %}">

              <span>Config Master</span>










 <div id="content-wrapper">


        <div class="container-fluid">


          <!-- Breadcrumbs-->

{#          <ol class="breadcrumb">#}

{#            <li class="breadcrumb-item">#}

{#              <a href="index.html">Dashboard</a>#}

{#            </li>#}

{#            <li class="breadcrumb-item active">Blank Page</li>#}

{#          </ol>#}


          <!-- Page Content -->

            {% block content %}

            {% endblock %}



        <!-- /.container-fluid -->


        <!-- Sticky Footer -->

{#        <footer class="sticky-footer">#}

{#          <div class="container my-auto">#}

{#            <div class="copyright text-center my-auto">#}

{#              <span>Copyright © Your Website 2018</span>#}

{#            </div>#}

{#          </div>#}

{#        </footer>#}



      <!-- /.content-wrapper -->



    <!-- /#wrapper -->


    <!-- Scroll to Top Button-->

    <a class="scroll-to-top rounded" href="#page-top">

      <i class="fas fa-angle-up"></i>



    <!-- Logout Modal-->

    <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">

      <div class="modal-dialog" role="document">

        <div class="modal-content">

          <div class="modal-header">

            <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>

            <button class="close" type="button" data-dismiss="modal" aria-label="Close">

              <span aria-hidden="true">×</span>



          <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>

          <div class="modal-footer">

            <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>

            <a class="btn btn-primary" href="/accounts/logout">Logout</a>







    <script src="{% static '/metroshop/js/main.js' %}" type="text/javascript"> </script>

   {% block scripts %}

    {% endblock %}






  • Create templates/metroshop/master_config.html


{% extends 'metroshop/base.html' %}

{% load static %}

{% block content %}


    <div class="card mb-3">

            <div class="card-header">

              <i class="fas fa-table"></i>

            <b>Company Config Master</b></div>


            <div class="card-body">


              <div class="table-responsive">

                <form id="master_config" name="master_config" method="post" action="{% url 'master_config_update'  %}" enctype="">

                  {% csrf_token %}

                <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">



                        <th>Name </th>








                    {% for Cinfo in m_config %}


                    {% endfor %}



                        <td><b>company Name </b></td>

                        <td><b></b><input type="text" name="company_name" value="{{Cinfo.company_name }}"></b></td></tr><tr>

                        <td><b>company Mobile</b></td>

                        <td><b><input type="text"  name="company_mobile" value="{{Cinfo.company_mobile }}"></b></td></tr><tr>

                        <td><b>company Address</b></td>

                        <td><b></b><textarea name="company_address" >{{ Cinfo.company_address }} </textarea></b></td>




                  <tr><td></td><td> <button class="submit" name="add_product_info" onClick="javascript:save_existing_product();">Submit</button></td></tr>













    {% endblock %}

<!-- Modal -->




  • python makemigrations




How to push files to particular GitHub branch by branch name

To push files to particular GitHub branch by branch name

STEP 1 : clone

# git clone --single-branch -b BRANCH_NAME**************.com.git

STEP 2: Config

# git config push.default upstream

STEP 3: Check out

#git checkout BRANCH_NAME

STEP 4: Do the changes and add

#git add .

STEP 5: Commit the changes

#git commit -m "home page change"

STEP 6: Finally

#git push origin BRANCH_NAME

You almost done