You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/appdev.rst
+6-9Lines changed: 6 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ Here's what the files and directories are for:
80
80
``Configs``:
81
81
Configuration files for the application. These files are copied from the ``Configs`` subdirectory in the ``webware`` package, but are specific to this application.
82
82
``Context``:
83
-
The directory for your default context. This is where you put your servlets. You can change its name and location with the ```-c`` and ``-d`` options. You can also change this subsequently in the ``Application.config`` file in the ``Configs`` directory, where you can also configure more than one context. You may also want to remove the other standard contexts that come with Webware from the config file.
83
+
The directory for your default context. This is where you put your servlets. You can change its name and location with the ``-c`` and ``-d`` options. You can also change this subsequently in the ``Application.config`` file in the ``Configs`` directory, where you can also configure more than one context. You may also want to remove the other standard contexts that come with Webware from the config file.
84
84
``error404.html``:
85
85
The static HTML page to be displayed when a page is not found. You can remove this to display a standard error message, modify the page according to your preferences, or use a custom error servlet instead by setting ``ErrorPage`` in the ``Application.config`` file appropriately.
86
86
``ErrorMsgs``:
@@ -312,14 +312,11 @@ print
312
312
313
313
The most common technique is the infamous ``print`` statement which has been replaced with a ``print()`` function in Python 3. The results of ``print()`` calls go to the console where the WSGI server was started (not to the HTML page as would happen with CGI). If you specify ``AppLogFilename`` in ``Application.config``, this will cause the standard output and error to be redirected to this file.
314
314
315
-
For convenient debugging, we recommend you use a clause like this in your ``Application.config`` file::
315
+
For convenient debugging, the default ``Application.config`` file already uses the following conditional setting::
316
316
317
-
if Development:
318
-
AppLogFilename = None
319
-
else:
320
-
AppLogFilename = 'Logs/Application.log'
317
+
AppLogFilename = None if Development else 'Logs/Application.log'
321
318
322
-
This will prevent standard output and error from being redirected to the log file in development mode, which makes it easier to find debugging output, and also makes it possible to use ```pdb``` (see below).
319
+
This will prevent standard output and error from being redirected to the log file in development mode, which makes it easier to find debugging output, and also makes it possible to use ``pdb`` (see below).
323
320
324
321
Prefixing the debugging output with a special tag (such as ``>>``) is useful because it stands out on the console and you can search for the tag in source code to remove the print statements after they are no longer useful. For example::
325
322
@@ -356,11 +353,11 @@ Assertions are used to ensure that the internal conditions of the application ar
356
353
357
354
Debugging using PDB
358
355
~~~~~~~~~~~~~~~~~~~
359
-
To use python's built-in debugger ```pdb```, see the tip above about setting ```AppLogFilename``` for convenient debugging.
356
+
To use Python's built-in debugger ``pdb``, see the tip above about setting ``AppLogFilename`` for convenient debugging.
360
357
361
358
To have Webware automatically put you into pdb when an exception occurs, set this in your ``Application.config`` file::
362
359
363
-
EnterDebuggerOnException = Development
360
+
EnterDebuggerOnException = Development
364
361
365
362
A quick and easy way to debug a particular section of code is to add these lines at that point in the code::
Copy file name to clipboardExpand all lines: docs/config.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ Sessions
79
79
``SessionModule``:
80
80
Can be used to replace the standard Webware Session module with something else. Default: ``Session``
81
81
``SessionStore``:
82
-
This setting determines which of five possible session stores is used by the Application: ``Dynamic``, ``File``, ``Memcached``, ``Memory``, ``Redis`` or ```Shelve``. The ``File`` store always gets sessions from disk and puts them back when finished. ``Memory`` always keeps all sessions in memory, but will periodically back them up to disk. ``Dynamic`` is a good cross between the two, which pushes excessive or inactive sessions out to disk. ``Shelve`` stores the sessions in a database file using the Python ``shelve`` module, ``Memcached`` stores them on a Memcached system using the ``python-memcached`` interface, and ``Redis`` stores them on a Redis system using the ``redis-py`` client. You can use a custom session store module as well. Default: ``Dynamic``.
82
+
This setting determines which of five possible session stores is used by the Application: ``Dynamic``, ``File``, ``Memcached``, ``Memory``, ``Redis`` or ``Shelve``. The ``File`` store always gets sessions from disk and puts them back when finished. ``Memory`` always keeps all sessions in memory, but will periodically back them up to disk. ``Dynamic`` is a good cross between the two, which pushes excessive or inactive sessions out to disk. ``Shelve`` stores the sessions in a database file using the Python ``shelve`` module, ``Memcached`` stores them on a Memcached system using the ``python-memcached`` interface, and ``Redis`` stores them on a Redis system using the ``redis-py`` client. You can use a custom session store module as well. Default: ``Dynamic``.
83
83
``SessionStoreDir``:
84
84
If ``SessionStore`` is set to ``File``, ``Dynamic`` or ``Shelve``, then this setting determines the directory where the files for the individual sessions or the shelve database will be stored. The path is interpreted as relative to the working directory (or Webware path, if you're not using a working directory), or you can specify an absolute path. Default: ``Sessions``.
85
85
``SessionTimeout``:
@@ -213,7 +213,7 @@ Logging
213
213
``ActivityLogColumns``:
214
214
Specifies the columns that will be stored in the activity log. Each column can refer to an object from the set [application, transaction, request, response, servlet, session] and then refer to its attributes using "dot notation". The attributes can be methods or instance attributes and can be qualified arbitrarily deep. Default: ``['request.remoteAddress', 'request.method', 'request.uri', 'response.size', 'servlet.name', 'request.timeStamp', 'transaction.duration', 'transaction.errorOccurred']``.
215
215
``AppLogFilename``:
216
-
The Application redirects standard output and error to this file, if this is set in production mode. Default: ```'Logs/Application.log'``.
216
+
The Application redirects standard output and error to this file, if this is set in production mode. Default: ``'Logs/Application.log'``.
217
217
``Verbose``:
218
218
If True, then additional messages are printed while the Application runs, most notably information about each request such as size and response time. Default: ``True``.
0 commit comments