GithubHelp home page GithubHelp logo

pyweb's Introduction

PyWeb

Implementation of a very simple webserver in Python (using Python3.8 to figure out new syntax) to learn and understand how it works.

How to use it?

  • Install Python3.8 from deadsnakes ppa
  • sudo add-apt-repository ppa:deadsnakes/ppa
  • sudo apt-get update
  • sudo apt-get install python3.8*
  • $ git clone https://github.com/ghostbill/pyweb.git
  • $ cd pyweb/
  • $ python3 -m venv venv
  • $ source venv/bin/activate
  • (venv) $ pip install --update pip
  • (venv) $ pip install pyramid
  • (venv) $ pip install flask
  • (venv) $ pip install django Start the server with:
  • (venv) $ python3 demoserver.py # Initial barebones server OR
  • (venv) $ python3 wsgiapp.py flaskapp:app # Test the wsgi concept with a flask app OR
  • (venv) $ python3 wsgiapp.py pyramidapp:app # Test the wsgi concept with a pyramid app OR
  • (venv) $ python3 wsgiapp.py flaskapp:app # Test the wsgi concept with a flask app

After trying one of the command to start/test the server go to your browser and type http://localhost:7777/hello or open a new terminal and type $ curl -v http://localhost:7777/hello

To test for concurrency:

  • (venv) $ python3 wsgidemoserver_con.py # To start the server

Try running multiple instances of http://localhost:7777/hello in your browser and curl -v http://localhost:7777/hello in your terminal and see how your server can handle multiple requests at the same time.

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.