Giter Club home page Giter Club logo

python-developement's Introduction

Welcome to Python Web Development.

PreRequisites:

  • Docker

Python Web Application can be developed

flask-app

If you want to build a light weight web application, you can choose flask module.

Run the below command to create sample flask App

docker run -d -p 5000:5000 anguda/python-flask-app

Access above container like below

localhost:8080/username

If you want to run a flask with MySQL DB connectivity, please run the below command

docker-compose up

No docker-compose installed? Don't worry, please follow the below steps with simple docker

Run the below simple docker commands to spin up docker containers

docker run -d -p 3306:3306 --name db anguda/mysql
docker run -d -p 5000:5000 --name flaskweb --link db:db anguda/python-flask-app:web

Are you intersted to build the docker images and explore source code, then follow the below steps.

  1. First build the Docker images for both flask app and MySQL DB

Run the below command to build flask app

cd flask/app
docker build -t flaskweb . --no-cache

Run the velow command to build MySQL image

cd flask/db
docker build -t mysqldb . --no-cache
  1. It's time for to run the docker containers

Run the below commands to run the applications

docker run -d -p 3306:3306 --name db mysqldb
docker run -d -p 5000:5000 --name flaskweb --link db:db flaskweb

Using Kubernets

Are you using kubernetes as a service, then here's commands to run your application as pods

kubectl create -f db-deployment.yaml

kubectl create -f app-deployment.yaml

To get nodeport of app deployment, run the below command

kubectl get svc

Usage

Access the web application with below url

localhost:5000/

django-app

Django is help to use Advanced Web Development

Run the below command to create a django simple web application

cd django
docker build -t mydjango . --no-cache

Run the below command to run the docker container

docker run -d -p 8000:8000 --name django mydjango

Usage

Access the web application with below url

localhost:8000/

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.