F.A.Q.

Q. Where are you from? I am from Patiala, Punjab.

Q. What is your Age? I am 19 years Old.

Q. Can you show all the basic Django Commands together?

// Creating Virtual Environment
    pip3 install virtualenv
    pip3 freeze
    virtualenv vnv

//Using Virtual Environment
    source ./vnv/bin/activate
    deactivate

// Installing Django
    pip3 install django

// Starting Django Project
    django -admin startproject [project_name]
    python manage.py runserver
    python manage.py migrate                   // migrate models
    python manage.py makemigrations
    python manage.py createsuperuser    // Creating a superuser account

    python manage.py startapp [appname]    // Creating a App

    pip3 freeze > requirements.txt

    pip3 install django cleanup         //add django_cleanup in settings in apps

    pip3 install -r requirements.txt  //use it when starting a project

Q. Can you show all the basic Docker Commands together?

docker login
docker ps  //show details of running container
docker ps -a // show deatials of all containers
docker run mongodb //pull and run the image
docker images // shows all the images available in pc
docker run -d container_id // run container in detached mode
docker stop container_id // stop the running container
docker start
docker run -p8000:80 image_name_id  // specifying ports here 8000 is new port and 80 is image port
docker logs container_id // shows logs of container
docker exec -it container_id/bin 'or' /bash // open the bash of a container
docker containers ls // show all the containers
docker container prune -f // delete all  the running and stopped containers
docker rm container_id // Remove a particular container
docker rmi image_id // Remove a particular image
docker build -t myimage //build the docker image
docker compose up --build // use docker-compose.yaml file
** How to push image on docker hub **
docker tag image-name username/image-name(repository name)
docker push tag

Q. How to host django website on azure with docker?

// install azure cli
az login
az acr login --name name_of_container_registery_on_azure
docker tag image_name container_link/repo  // here repo is mainly container name e.g. docker tag resourcehub_image resourcehub12121.azurecr.io/container1
docker push resourcehub12121.azurecr.io/container1
// Now just create a container instance

Q. How to Create a Pull Request in a forked Repositoy

git clone https://github.com/<your-username>/<repo-name>  


cd <repo-name>  
git remote add upstream https://github.com/<upstream-owner>/<repo-name>
git remote -v # To the check the remotes for this repository 

git remote update
git checkout <branch-name>
git rebase upstream/<branch-name>

git branch
git checkout -b branch_name
git checkout -d branch_name

git add .  

git add <file name>

git commit -m "message"  

git push origin branch_name