Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Gunicron running.py file HOW-TO
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mark Huang  
View profile  
 More options Aug 19 2012, 1:30 pm
From: Mark Huang <zhengha...@gmail.com>
Date: Sun, 19 Aug 2012 10:30:43 -0700 (PDT)
Local: Sun, Aug 19 2012 1:30 pm
Subject: Gunicron running.py file HOW-TO

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
León Domingo  
View profile   Translate to Translated (View Original)
 More options Aug 19 2012, 3:25 pm
From: León Domingo <leon.domi...@ender.es>
Date: Sun, 19 Aug 2012 12:25:29 -0700 (PDT)
Local: Sun, Aug 19 2012 3:25 pm
Subject: Re: Gunicron running.py file HOW-TO

Hi Mark,
As fas as I know there's no need for "running.py" file.

Take a look at this
http://gunicorn.org/run.html#contents

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Huang  
View profile  
 More options Aug 19 2012, 10:27 pm
From: Mark Huang <zhengha...@gmail.com>
Date: Sun, 19 Aug 2012 19:27:26 -0700 (PDT)
Local: Sun, Aug 19 2012 10:27 pm
Subject: Re: Gunicron running.py file HOW-TO

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Randall Leeds  
View profile  
 More options Aug 23 2012, 2:51 pm
From: Randall Leeds <randall.le...@gmail.com>
Date: Thu, 23 Aug 2012 11:51:09 -0700
Local: Thurs, Aug 23 2012 2:51 pm
Subject: Re: Gunicron running.py file HOW-TO

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

app = loadapp('config:production.ini', relative_to='.')
paste_server(app, host='0.0.0.0', port=port, ...)
```

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »