# dynamicWebsite v1.4.4
```pip install dynamicWebsite --upgrade```
###### <br>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."
<br>To install:
```
pip install dynamicWebsite --upgrade
pip3 install dynamicWebsite --upgrade
python -m pip install dynamicWebsite --upgrade
python3 -m pip install dynamicWebsite --upgrade
```
#### <br><br>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
###### <br>This project is always open to suggestions and feature requests.
Raw data
{
"_id": null,
"home_page": null,
"name": "dynamicWebsite",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "website, dynamic website, update website, live website, change website, websocket",
"author": null,
"author_email": "Bhindi <bhaskarpanja93@gmail.com>, riyapuri0710 <riyapuri0710@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/ee/d6/efcd6c4208dc5d80b352015f701e7393a870a083f323bd48d52d9fed5e52/dynamicwebsite-1.4.4.tar.gz",
"platform": null,
"description": "# dynamicWebsite v1.4.4\n\n```pip install dynamicWebsite --upgrade```\n\n###### <br>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.\"\n\n<br>To install: \n```\npip install dynamicWebsite --upgrade\npip3 install dynamicWebsite --upgrade\npython -m pip install dynamicWebsite --upgrade\npython3 -m pip install dynamicWebsite --upgrade\n```\n\n\n#### <br><br>Using this program is as simple as:\n```\n\nfrom dynamicWebsite import *\n\n\ndef process_form(viewerObj: BaseViewer, form: dict):\n if form.get(\"PURPOSE\") == \"SHOW_IMAGE1\":\n initial = f'''<img src=\"\" alt=\"IMG1\"></img>'''\n viewerObj.queueTurboAction(initial, \"mainDiv\", turboApp.methods.update)\n elif form.get(\"PURPOSE\") == \"SHOW_IMAGE2\":\n initial = f'''<img src=\"\" alt=\"IMG2\"></img>'''\n viewerObj.queueTurboAction(initial, \"mainDiv\", turboApp.methods.update)\n\n\n\ndef newVisitor(viewerObj: BaseViewer):\n initial = f'''\n <form onsubmit=\"return submit_ws(this)\">\n {viewerObj.addCSRF(\"SHOW_IMAGE1\")}\n <input type=\"text\" name=\"username\"><br>\n <input type=\"password\" name=\"password\"><br>\n <input type=\"file\" name=\"ball\" multiple><br>\n <button type=\"submit\">Search</button>\n </form>\n '''\n viewerObj.queueTurboAction(initial, \"mainDiv\", turboApp.methods.update)\n\n\ndef visitorLeft(viewerObj: BaseViewer):\n print(f\"Visitor Left: {viewerObj.viewerID}\")\n\n\nextraHeads = \"\"\nfernetKey = 'JJafcmKx6WRzZKhC8THl7tfXce2BVdYEntGHPJNFwSU='\nbodyBase = \"\"\"<body><div id=\"mainDiv\"></div></body>\"\"\"\ntitle = \"Song Player\"\nresetOnDisconnect = False\nbaseApp, turboApp = createApps(process_form, newVisitor, visitorLeft, \"Song Player\", \"/\", fernetKey, extraHeads, bodyBase, title, resetOnDisconnect)\n\nbaseApp.run(\"0.0.0.0\", 5000)\n\n```\n\n\n### Future implementations:\n* Adding ability to add classes and other HTML arguments to elements created\n* Adding templates for various uses\n\n\n###### <br>This project is always open to suggestions and feature requests.\n",
"bugtrack_url": null,
"license": null,
"summary": "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.",
"version": "1.4.4",
"project_urls": {
"Homepage": "https://github.com/BhaskarPanja93/dynamicWebsite"
},
"split_keywords": [
"website",
" dynamic website",
" update website",
" live website",
" change website",
" websocket"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2c7c94d6923a1135360fdd528ad7dc19411a7ce58badbb102710cde1637779b3",
"md5": "c52259381b740b8db4b47158def50fa7",
"sha256": "82255c3957a5fd28008ad84a2b517f4131ef37370e00be7d20449cd83d06a5de"
},
"downloads": -1,
"filename": "dynamicWebsite-1.4.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c52259381b740b8db4b47158def50fa7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 11248,
"upload_time": "2024-11-30T07:32:19",
"upload_time_iso_8601": "2024-11-30T07:32:19.795912Z",
"url": "https://files.pythonhosted.org/packages/2c/7c/94d6923a1135360fdd528ad7dc19411a7ce58badbb102710cde1637779b3/dynamicWebsite-1.4.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "eed6efcd6c4208dc5d80b352015f701e7393a870a083f323bd48d52d9fed5e52",
"md5": "8af7a4a757dd88f9f34cb2d17d70e910",
"sha256": "7afa1dd73a106298f4e9da20a9703881e07f6d5291dfcb452ee65d63d6c445e1"
},
"downloads": -1,
"filename": "dynamicwebsite-1.4.4.tar.gz",
"has_sig": false,
"md5_digest": "8af7a4a757dd88f9f34cb2d17d70e910",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 11379,
"upload_time": "2024-11-30T07:32:33",
"upload_time_iso_8601": "2024-11-30T07:32:33.452555Z",
"url": "https://files.pythonhosted.org/packages/ee/d6/efcd6c4208dc5d80b352015f701e7393a870a083f323bd48d52d9fed5e52/dynamicwebsite-1.4.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-30 07:32:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "BhaskarPanja93",
"github_project": "dynamicWebsite",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "dynamicwebsite"
}