Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

IdeaPy is a simple WWW server built on top of CherryPy, with Python code execution feature

Project description

============================
IdeaPy (Idea for Python)
============================

IdeaPy is a simple WWW server built on top of CherryPy, with Python code execution feature.


Features
----------------------------------
- ability to execute Python code
just like Apache2 + mod_php
- all static files are streamed
by default
- you can add unlimited
number of virtual hosts
- one dependency: CherryPy


Example: "Hello World" in a IdeaPy
----------------------------------
python3 -m ideapy

go to http://localhost:8888/examples/default_page/
or http://localhost:8888/ to view directory listing


Own usage
----------------------------------

import ideapy

IdeaPy.setup_cherrypy() #optional
idea = IdeaPy()

idea.start()
idea.block()


Advanced usage
----------------------------------
import ideapy

IdeaPy.setup_cherrypy() #optional
idea = IdeaPy()

#change CherryPy config, like sessions, etc.

#now add some virtual hosts

#to serve content on http://localhost:8080
#with directory index disabled
idea.add_virtual_host(
document_root='/',
listen_ips=['127.0.0.1'],
listen_port=8080,
opt_indexes=False)

#to serve content on
#http://localhost:8080, http://api.localhost:8080, http://api:8080
#with directory index disabled
idea.add_virtual_host(
document_root='/',
listen_ips=['127.0.0.1'],
listen_port=8080,
server_name='localhost',
server_aliases=['api'],
opt_indexes=False)

#to serve /jinja2_app/ directory on
#http://virtualbox:8443, http://jinja2_app:8443, http://jinja2_app.virtualbox:8443
#https://virtualbox:8443, https://jinja2_app:8443, https://jinja2_app.virtualbox:8443
#with SSL enabled
idea.add_virtual_host(
document_root='/jinja2_app/',
listen_ips=['0.0.0.0'],
listen_port=8443,
server_name='virtualbox',
server_aliases=['jinja2_app'],
ssl_certificate = '/bundle.crt',
ssl_private_key = '/private_key.key')

idea.start()
idea.block()


Homepage
----------------------------------
https://github.com/skazanyNaGlany/ideapy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
ideapy-0.1.6.tar.gz (11.9 kB) Copy SHA256 hash SHA256 Wheel 3.4

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page