-
Essay / Webware for Python - 763
OverviewWebware for Python is a suite of Python packages and tools for developing object-oriented web applications. The suite uses well-known design patterns and includes a fast application server, servlets, Python Server Pages (PSP), object-relational mapping, task scheduling, session management and many other features . Webware is modular and extensible. The Webware version currently used at Texas Life is version 0.8. Information about web software, including documentation and source code, can be found at http://www.webwareforpython.org/.Webware ScriptsOrganization & Script LocationEach of the three web servers - WebProd, WebModel and WebDevelop - has dedicated programs to run each individual web server. system. These programs are contained in the Context/ directory of each web server, /WebApp/webserver/Context/. Development is done in /WebApp/WebDevelop/Context/; model testing is done in /WebApp/WebModel/Context/; and production is in /WebApp/WebProd/Context/. Only WebDevelop is accessible to all programmers. Every web system - for example, Agency, WebBill, etc. - is contained in a subdirectory of Context/. The subdirectory name identifies the web system files it contains; for example, /WebApp/webserver/Context/Agency/ contains all files specifically for running agent support pages. These directories also contain the .pyc file(s) that are created when a Python program runs. The Context/ directory itself contains files related to ALL web systems. Changes to files affect all web systems. For this reason, files in the Context/ directory cannot be modified by traditional programmers. ANY changes to these files must be approved in advance and installed by the web system...... middle of paper ......k.Using strings to accumulate HTML codeDo not use multiple d statements 'write' or when writing HTML code to a Webware servlet, unless absolutely necessary. Excessive use of write and writeln slows down the creation of the HTML page offered to the client. Instead, whenever possible, create a string variable to accumulate the HTML and use a single write statement. Don't embed JavaScript in HTML Avoid embedded scripts whenever possible. If you must use an embedded script, immediately before the embedded script, insert Python comments explaining the purpose of the script and why it should be embedded. No Visible Comments Do not use HTML, Javascript, or CSS comments unless you specifically want them to be visible to anyone viewing the page source. Instead, use Python comments separate from HTML to explain and document your coding..