OverviewWebware for Python is a suite of Python packages and tools for developing object-oriented Web-based 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 version of the Webware currently in use at Texas Life is version 0.8. Information about Webware, 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 for the execution of every single web system. These programs are contained in the Context/ directory for each Web server, /WebApp/webserver/Context/. Development is done in /WebApp/WebDevelop/Context/; model testing is done in /WebApp/WebModel/Context/; and the 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 name of the subdirectory identifies which web system files it contains; for example, /WebApp/webserver/Context/Agency/ contains all the files specific to running the agent support pages. These directories also contain .pyc files that are created when a Python program runs. The Context/ directory itself contains files related to ALL web systems. Changes made to files affect every web system. For this reason, files in the Context/ directory cannot be modified by normal programmers. ANY changes to such files must be approved in advance and installed by the web system... middle of paper......k.Use strings to accumulate HTML codeNo longer use write or writeln statements when writing HTML code in a Webware servlets except where absolutely necessary. Excessive use of write and writeln slows down the creation of the HTML page served to the client. Instead, whenever possible, create a string variable to accumulate the HTML code and use a single write statement. Don't embed JavaScript in HTML. Avoid embedded scripts whenever possible. If you need to use an embedded script, immediately before the embedded script insert Python comments that explain the purpose of the script and why it needs to be embedded. No Viewable Comments Don't use HTML, Javascript, or CSS comments unless you specifically want them to be viewable by anyone viewing the page's source script. Instead, use Python comments separate from the HTML to explain and document your coding.
tags