Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/angudadevops/python-developement
Python Web Application with Flask
https://github.com/angudadevops/python-developement
django django-app docker-compose-python flask flask-application flask-mysql flask-web python python-docker python-mysql-test python-sample python-send python-web-development sample-web-application
Last synced: 9 days ago
JSON representation
Python Web Application with Flask
- Host: GitHub
- URL: https://github.com/angudadevops/python-developement
- Owner: angudadevops
- Created: 2020-04-29T22:35:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T18:39:02.000Z (over 3 years ago)
- Last Synced: 2023-07-19T19:56:02.311Z (over 1 year ago)
- Topics: django, django-app, docker-compose-python, flask, flask-application, flask-mysql, flask-web, python, python-docker, python-mysql-test, python-sample, python-send, python-web-development, sample-web-application
- Language: Python
- Size: 112 KB
- Stars: 1
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Welcome to Python Web Development.
PreRequisites:
- DockerPython Web Application can be developed
- [Flask](#flask-app)
- [Django](#django-app)## 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
```
2. It's time for to run the docker containersRun 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.yamlkubectl 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 DevelopmentRun 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/
```