Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
webserver in python?
#1
i am looking for a web server coded entirely in python.  it should be usable in place of servers like apache and nginx in the sense of how it is administered: install, config, launch (with read docs where needed).  it should use mostly standard modules with a minimum that need to be installed (and all non-standard ones should be pure python).  it should support CGI although if that support is limited to scripts in python, that's ok.  it must support multiple domains sharing the same IP address in the standard way.  it must support web sites configured on alternate ports.  it must support HTTPS.

is there such a thing?  if there are multiple, which is best?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
I always start with the build web-server for Flask or Django when i build stuff local.
If i deploy i use Gunicorn with NGINX,this has a lot of power and are fairly simple to setup.
An other combo is that is used for Python is uWSGI with NGINX.

Eg Instagram use Gunicorn,they have a good approach to this:
Quote:
  • Keep it very simple
  • Don’t re-invent the wheel
  • Go with proven and solid technologies when you can

Quote:it should support CGI although if that support is limited to scripts in python, that's ok.  
No it should not,CGI is dead or should be for all Python usages.
The story is like this Python community did know that CGI was a bad approach,
so they went together to write an all Python solution WSGI and specified first in pep-333(2003) then later in pep-3333.
All Python web-framework is now build on WSGI.
Eg You see on Flask first page:
Quote:100% WSGI 1.0 compliant
Reply
#3
the plan is to transition from CGI to WSGI on this server.  having support for both is vrucial.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
Why is it crucial? You'd never use both at the same time.
Reply
#5
(Mar-24-2017, 04:52 PM)nilamo Wrote: Why is it crucial?  You'd never use both at the same time.

sure i would.  i have more that one site using CGI.  once i change one site to WSGI then that begins the interim period when both are in use.  my VPS server in .nl currently has 1 IPv4 address and 18446744073709551616 IPv6 addresses.  only one server process at a time can listen to the same address and port (80) at the same time.  i am thinking there may be a way to configure an additional regular web server to do the CGI stuff relayed via WSGI.  i need to spend some time testing these schemes since if i can get one work it can reduce my needs.  i need to choose python based WSGI setup in that base.  i'd like to get some test code to make a quick and correct off-port WSGI web site that way.

fyi, i did make a little web server in python.  but it is definitely not wsgi based.  it does load modules address by the web request.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020