librelist archives

« back to archive

flask traffic not getting past gunicorn

flask traffic not getting past gunicorn

From:
Lowell Kirsh
Date:
2012-05-09 @ 22:15
I have a new project and just wrote my first dynamic route. When I run with
the built in server, my app works fine. But when I use gunicorn, the
request to the new route never gets past gunicorn, with gunicorn issuing a
500. What am I doing wrong?

Here is relevant code from my app.py:

app = Flask(__name__)

app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
    '/': os.path.join(os.path.dirname(__file__), 'static')
})

@app.route('/')
def hello():
    return flask.redirect('index.html')


@app.route('/keys/')
def yelp_keys():
    return jsonify(app.config['KEYS'])


Thanks!

Re: [flask] flask traffic not getting past gunicorn

From:
Ron DuPlain
Date:
2012-05-09 @ 22:17
Hi Lowell,

On Wed, May 9, 2012 at 6:15 PM, Lowell Kirsh <lowellk@gmail.com> wrote:
> I have a new project and just wrote my first dynamic route. When I run with
> the built in server, my app works fine. But when I use gunicorn, the request
> to the new route never gets past gunicorn, with gunicorn issuing a 500. What
> am I doing wrong?
>
> Here is relevant code from my app.py:
>
> app = Flask(__name__)
>
> app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
>     '/': os.path.join(os.path.dirname(__file__), 'static')
> })
>
> @app.route('/')
> def hello():
>     return flask.redirect('index.html')
>
>
> @app.route('/keys/')
> def yelp_keys():
>     return jsonify(app.config['KEYS'])
>
>
> Thanks!

Could you provide the command you are using to run gunicorn?

-Ron

Re: [flask] flask traffic not getting past gunicorn

From:
Lowell Kirsh
Date:
2012-05-09 @ 23:09
Hey, I realize now that the traffic was indeed getting past unicorn and it
was flask that was throwing the 500. I still have a problem but will start
another thread for that...

On Wed, May 9, 2012 at 3:17 PM, Ron DuPlain <ron.duplain@gmail.com> wrote:

> Hi Lowell,
>
> On Wed, May 9, 2012 at 6:15 PM, Lowell Kirsh <lowellk@gmail.com> wrote:
> > I have a new project and just wrote my first dynamic route. When I run
> with
> > the built in server, my app works fine. But when I use gunicorn, the
> request
> > to the new route never gets past gunicorn, with gunicorn issuing a 500.
> What
> > am I doing wrong?
> >
> > Here is relevant code from my app.py:
> >
> > app = Flask(__name__)
> >
> > app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
> >     '/': os.path.join(os.path.dirname(__file__), 'static')
> > })
> >
> > @app.route('/')
> > def hello():
> >     return flask.redirect('index.html')
> >
> >
> > @app.route('/keys/')
> > def yelp_keys():
> >     return jsonify(app.config['KEYS'])
> >
> >
> > Thanks!
>
> Could you provide the command you are using to run gunicorn?
>
> -Ron
>



-- 
http://lowellkirsh.com