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.4

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.4.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: dynamicwebsite-1.4.4.tar.gz
  • Upload date:
  • Size: 11.4 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.4.tar.gz
Algorithm Hash digest
SHA256 7afa1dd73a106298f4e9da20a9703881e07f6d5291dfcb452ee65d63d6c445e1
MD5 8af7a4a757dd88f9f34cb2d17d70e910
BLAKE2b-256 eed6efcd6c4208dc5d80b352015f701e7393a870a083f323bd48d52d9fed5e52

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dynamicWebsite-1.4.4-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for dynamicWebsite-1.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 82255c3957a5fd28008ad84a2b517f4131ef37370e00be7d20449cd83d06a5de
MD5 c52259381b740b8db4b47158def50fa7
BLAKE2b-256 2c7c94d6923a1135360fdd528ad7dc19411a7ce58badbb102710cde1637779b3

See more details on using hashes here.

Supported by

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