Once you install gunicorn a *gunicorn_paster* command is available. This command makes your Pyramid (Paster-like) application run. I use it with nginx and supervisor
On Sunday, 19 August 2012 19:30:43 UTC+2, Mark Huang wrote:
> Hi,
> I was reading the Pyramid cookbook and found the Heroku deployment guide. > There's a section inside that talks about creating a file called > running.py:
> import os
> from paste.deploy import loadappfrom waitress import serve
> if __name__ == "__main__":
> port = int(os.environ.get("PORT", 5000))
> app = loadapp('config:production.ini', relative_to='.')
> serve(app, host='0.0.0.0', port=port)
> I was wondering how to create one for Gunicorn? I could not find anything similar to the serve function in Gunicorn.
> Once you install gunicorn a *gunicorn_paster* command is available. This > command makes your Pyramid (Paster-like) application run. I use it with > nginx and supervisor
> Hope it helps
> León
> On Sunday, 19 August 2012 19:30:43 UTC+2, Mark Huang wrote:
>> Hi,
>> I was reading the Pyramid cookbook and found the Heroku deployment guide. >> There's a section inside that talks about creating a file called >> running.py:
>> import os
>> from paste.deploy import loadappfrom waitress import serve
>> if __name__ == "__main__":
>> port = int(os.environ.get("PORT", 5000))
>> app = loadapp('config:production.ini', relative_to='.')
>> serve(app, host='0.0.0.0', port=port)
>> I was wondering how to create one for Gunicorn? I could not find anything similar to the serve function in Gunicorn.
On Sun, Aug 19, 2012 at 7:27 PM, Mark Huang <zhengha...@gmail.com> wrote:
> Oh yeah....that's actually what I'm doing right now, but I just thought
> there was a way to "Python-ize" it like that running.py script.
Something like this should do the trick:
```
from gunicorn.app.pasterapp import paste_server
from paste.deploy app_config, load_app
Other kwargs available to paste_server are 'workers', 'bind', 'user',
'group', 'proc_name', and 'logger_class' (properties from
gunicorn.config.Config).
You can also pass a global config from paster as the second argument
(such as if you did appconfig() instead of loadapp()), but I'm not
sure it's necessary to pass to gunicorn for any reason.
>> Once you install gunicorn a gunicorn_paster command is available. This
>> command makes your Pyramid (Paster-like) application run. I use it with
>> nginx and supervisor
>> Hope it helps
>> León
>> On Sunday, 19 August 2012 19:30:43 UTC+2, Mark Huang wrote:
>>> Hi,
>>> I was reading the Pyramid cookbook and found the Heroku deployment guide.
>>> There's a section inside that talks about creating a file called running.py:
>>> import os
>>> from paste.deploy import loadapp
>>> from waitress import serve
>>> if __name__ == "__main__":
>>> port = int(os.environ.get("PORT", 5000))
>>> app = loadapp('config:production.ini', relative_to='.')
>>> serve(app, host='0.0.0.0', port=port)
>>> I was wondering how to create one for Gunicorn? I could not find
>>> anything similar to the serve function in Gunicorn.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-discuss+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.