On Fri, Nov 6, 2015 at 1:39 PM, Jonathan Vanasco <jonat...@findmeon.com> wrote:
> * pyramid is deployed via uwsgi , which is controlled by supervisord. > * uwsgi is invoked using the `--ini-paste--logged` argument, which which > points to the "production.ini" > > I was thinking that the easiest way to enable/disable the admin routes would > be to just set an environment variable in supervisord and just look for it > in the app. something like... > > [program:myapp-main] > ... > environment = MYAPP_DISABLE_ADMIN=1 > command = uwsgi --ini-paste-logged production.ini > > [program:myapp-admin] > ... > command = uwsgi --ini-paste-logged production.ini > > Does this sound like a good idea? Has anyone else done this, or used > another method? I've done it for development; I have a settings-validation routine that reads a couple optional environment variables to enable/disable the debug toolbar without changing the INI file. The ideal way would be to have a different INI file for different kinds of deployment, but if you don't want to do that then an environment variable is a reasonable choice. CGI uses environment variables for basic information about the request, and the simplest form of authentication is the REMOTE_USER variable. -- Mike Orr <sluggos...@gmail.com> -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscr...@googlegroups.com. To post to this group, send email to pylons-discuss@googlegroups.com. Visit this group at http://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/d/optout.