gunicorn starts web.py in debug mode

302 views
Skip to first unread message

kevin

unread,
Oct 30, 2010, 10:02:53 PM10/30/10
to we...@googlegroups.com
code.py:
app = web.application(urls, locals())
app_wsgi = app.wsgifunc(session_mw)




gunicorn code:app_wsgi

if i run gunicorn like this, web.config.debug is True. what is the correct way to deploy using gunicorn so web.config.debug is False?

Anand Chitipothu

unread,
Oct 30, 2010, 10:30:24 PM10/30/10
to we...@googlegroups.com
2010/10/31 kevin <kevincas...@gmail.com>:

The only way right now is to set web.config.debug = False before
creating the app.

Anand

kevin

unread,
Oct 31, 2010, 1:19:13 PM10/31/10
to we...@googlegroups.com

that makes it difficult for development/deployment, changing it everytime.

if i run gunicorn like this:
PHP_FCGI_CHILDREN=3 gunicorn code:app_wsgi

web.py does not start in debug mode. do you know what is going on? is it ok to do like this?

Anand Chitipothu

unread,
Oct 31, 2010, 8:31:23 PM10/31/10
to we...@googlegroups.com
web.config.debug is set to False by default if you run the latest
version of gunicorn.

The latest version of gunicorn passes SERVER_SOFTWARE environment
variable to the worker process and web.py sets debug=False when
SERVER_SOFTWARE is available in env.

Anand

2010/10/31 kevin <kevincas...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups
> "web.py" group.
> To post to this group, send email to we...@googlegroups.com.
> To unsubscribe from this group, send email to
> webpy+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.
>

kevin

unread,
Oct 31, 2010, 8:47:01 PM10/31/10
to we...@googlegroups.com
thanks for the reply.


i updated to latest gunicorn, but it is still starting with debug mode True.

i have domain based sub applications. is there anything i can do to fix this?

$ gunicorn --version
0.11.2.e52f06c-git



code.py:

import a,b
mappings = (
  "A.APP.com", a.app,
  "B.APP.com", b.app,
)

def session_mw(app):
    return SessionMiddleware(app, **config_beaker)


subdomain_app = web.subdomain_application(mappings)
subdomain_app_wsgi = subdomain_app.wsgifunc(session_mw)




running gunicorn:
gunicorn code:subdomain_app_wsgi

kevin

unread,
Oct 31, 2010, 8:56:35 PM10/31/10
to we...@googlegroups.com
actually, i was running gunicorn like this

gunicorn -c config_gunicorn.py code:subdomain_app_wsgi


and config_gunicorn.py has
import web

i need web.py in config_gunicorn to connect to a database for post_request & pre_request functions.

if i remove import web from config_gunicorn.py, then the app starts with debug mode=False.


so here is the problem:

if a config file used to start gunicorn, and if web.py is imported in it, app starts in debug mode.
Reply all
Reply to author
Forward
0 new messages