-=Thanks to Ben Bangert for this quick script to get your Pyramid app up and running with Gunicorn=-
You can easily run Gunicorn with the production.ini (or development.ini) file you've been using with Waitress (or Paster for older Pyramid installs), and still start it with `pserve production.ini`. Just replace the [server:main] section within production.ini as shown here--> http://gunicorn.org/run.html#paster-serve Or, if you want to run Gunicorn directly, make a runapp.py file in your project, dump this into it: > from paste.deploy import loadapp > > application = loadapp('config:production.ini', relative_to='.') and then you can run: gunicorn runapp If you'd like to include some additional configurations using the runapp.py approach, create a config file named gunicorn_config.py (or whatever you'd like) that looks like this: > import multiprocessing > > try: > import gevent > wc = "gevent" > except ImportError: > wc = "sync" > > bind = "127.0.0.1:5040" > workers = multiprocessing.cpu_count() * 2 + 1 > worker_class = wc > timeout = 3 > proc_name = "myapp" > pidfile = "myapp.pid" So the full command to start Gunicorn then becomes: gunicorn -c gunicorn_config.py runapp This above config file is a random example of some settings you may have. More can be found here--> http://gunicorn.org/configure.html -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
