Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
a8e04abb
Commit
a8e04abb
authored
Aug 07, 2016
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a convinient way to enable Zope's debug mode from the runwsgi command.
parent
d4cf3d19
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
0 deletions
+38
-0
docs/operation.rst
docs/operation.rst
+12
-0
src/App/ApplicationManager.py
src/App/ApplicationManager.py
+3
-0
src/App/dtml/cpContents.dtml
src/App/dtml/cpContents.dtml
+12
-0
src/Zope2/Startup/run.py
src/Zope2/Startup/run.py
+3
-0
src/Zope2/Startup/serve.py
src/Zope2/Startup/serve.py
+8
-0
No files found.
docs/operation.rst
View file @
a8e04abb
...
...
@@ -45,6 +45,18 @@ To run Zope without detaching from the console, use:
In this mode, Zope emits its log messages to the console, and does not
detach from the terminal.
By default this command does not enable Zope's debug mode, so it can
be used for production.
In order to enable debug_mode, you can add the additional `-d` or
``--debug`` argument to the command:
.. code-block:: sh
$ bin/runwsgi -v etc/zope.ini -d
Starting server in PID 55111.
serving on http://127.0.0.1:8080
The runwsgi commands takes a PasteDeploy configuration file as its
argument. You can configure different WSGI capable servers,
the WSGI pipeline or logging configuration in this file.
...
...
src/App/ApplicationManager.py
View file @
a8e04abb
...
...
@@ -177,6 +177,9 @@ class ApplicationManager(Folder, CacheManager):
def
thread_get_ident
(
self
):
return
get_ident
()
def
debug_mode
(
self
):
return
getConfiguration
().
debug_mode
def
db_name
(
self
):
return
self
.
_p_jar
.
db
().
getName
()
...
...
src/App/dtml/cpContents.dtml
View file @
a8e04abb
...
...
@@ -67,6 +67,18 @@ The Control Panel provides access to system information.
</div>
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Debug mode
</div>
</td>
<td align="left" valign="top">
<div class="form-text">
&dtml-debug_mode;
</div>
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
...
...
src/Zope2/Startup/run.py
View file @
a8e04abb
...
...
@@ -58,6 +58,9 @@ def make_wsgi_app(global_config, zope_conf):
from
ZPublisher.WSGIPublisher
import
publish_module
starter
=
get_wsgi_starter
()
opts
=
ZopeWSGIOptions
(
configfile
=
zope_conf
)()
if
'debug_mode'
in
global_config
:
if
global_config
[
'debug_mode'
]
in
(
'true'
,
'on'
,
'1'
):
opts
.
configroot
.
debug_mode
=
True
handleWSGIConfig
(
opts
.
configroot
,
opts
.
confighandlers
)
setConfiguration
(
opts
.
configroot
)
starter
.
setConfiguration
(
opts
.
configroot
)
...
...
src/Zope2/Startup/serve.py
View file @
a8e04abb
...
...
@@ -122,6 +122,12 @@ and then use %(http_port)s in your config files.
const
=
0
,
dest
=
'verbose'
,
help
=
"Suppress verbose output"
)
parser
.
add_option
(
'-d'
,
'--debug'
,
action
=
'store_const'
,
const
=
1
,
dest
=
'debug'
,
help
=
"Enable debug mode."
)
_scheme_re
=
re
.
compile
(
r'^[a-z][a-z]+:'
,
re
.
I
)
...
...
@@ -170,6 +176,8 @@ and then use %(http_port)s in your config files.
server
=
self
.
loadserver
(
server_spec
,
name
=
server_name
,
relative_to
=
base
,
global_conf
=
vars
)
if
'debug_mode'
not
in
vars
and
self
.
options
.
debug
:
vars
[
'debug_mode'
]
=
'true'
app
=
self
.
loadapp
(
app_spec
,
name
=
app_name
,
relative_to
=
base
,
global_conf
=
vars
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment