Skip to main content

A simple way to host web server bundled with websocket to send and receive live data, from client to server, and pass live HTML changes from server to client without having to refresh the page.

Project description

dynamicWebsite v1.4.2

pip install dynamicWebsite --upgrade


A simple way to host web server bundled with websocket to send and receive live data, from client to server, and pass live HTML changes from server to client without having to refresh the page."


To install:

pip install dynamicWebsite --upgrade
pip3 install dynamicWebsite --upgrade
python -m pip install dynamicWebsite --upgrade
python3 -m pip install dynamicWebsite --upgrade



Using this program is as simple as:


from dynamicWebsite import *


def process_form(viewerObj: BaseViewer, form: dict):
    if form.get("PURPOSE") == "SHOW_IMAGE1":
        initial = f'''<img src="" alt="IMG1"></img>'''
        viewerObj.queueTurboAction(initial, "mainDiv", turboApp.methods.update)
    elif form.get("PURPOSE") == "SHOW_IMAGE2":
        initial = f'''<img src="" alt="IMG2"></img>'''
        viewerObj.queueTurboAction(initial, "mainDiv", turboApp.methods.update)



def newVisitor(viewerObj: BaseViewer):
    initial = f'''
               <form onsubmit="return submit_ws(this)">
               {viewerObj.addCSRF("SHOW_IMAGE1")}
                   <input type="text" name="username"><br>
                   <input type="password" name="password"><br>
                   <input type="file" name="ball" multiple><br>
                   <button type="submit">Search</button>
               </form>
               '''
    viewerObj.queueTurboAction(initial, "mainDiv", turboApp.methods.update)


def visitorLeft(viewerObj: BaseViewer):
    print(f"Visitor Left: {viewerObj.viewerID}")


extraHeads = ""
fernetKey = 'JJafcmKx6WRzZKhC8THl7tfXce2BVdYEntGHPJNFwSU='
bodyBase = """<body><div id="mainDiv"></div></body>"""
title = "Song Player"
resetOnDisconnect = False
baseApp, turboApp = createApps(process_form, newVisitor, visitorLeft, "Song Player", "/", "/", fernetKey, extraHeads, bodyBase, title, resetOnDisconnect)

baseApp.run("0.0.0.0", 5000)

Future implementations:

  • Adding ability to add classes and other HTML arguments to elements created
  • Adding templates for various uses

This project is always open to suggestions and feature requests.

Project details


Download files

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

Source Distribution

dynamicwebsite-1.4.2.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

dynamicWebsite-1.4.2-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file dynamicwebsite-1.4.2.tar.gz.

File metadata

  • Download URL: dynamicwebsite-1.4.2.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for dynamicwebsite-1.4.2.tar.gz
Algorithm Hash digest
SHA256 8476b9c012bc9c99de4a70ea3dfa98640e65ff8c354ece6f999126ce9bf4c2d9
MD5 88f465b8408ab285e501998b891b58a4
BLAKE2b-256 16c9f9cd9f9517caf18c5045d71289cb599df5c78398032b331c57ac9b638706

See more details on using hashes here.

File details

Details for the file dynamicWebsite-1.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for dynamicWebsite-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1264b5029f0452d426dceaf08a1ad53e65661f3a3cca26b50e92e577f4c93caf
MD5 93e4a7477f254366d735881bcdb30477
BLAKE2b-256 a620f3884a3afa04a9b4274dcc855c7a9da1c9f18da1cfabb198d8232dec9787

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page