librelist archives

« back to archive

uWSGI configuration for flask app

uWSGI configuration for flask app

From:
Kundan Singh
Date:
2013-05-25 @ 07:53
Hi... I am trying to configure my flask app using uWSGI, Nginx but i'm
facing lot of trouble.

My Flask app's structure is:
  ************************************************************
**********************
 */var/www/flasksite.com*
                     * runserver.py*  #my file having __name__ == __'main'__
                      */venv*  #virtualenv folder containing *pip install
Flask*
                     * /flasksite* # folder containing app files __init__,
models.py files.

***********************************************************************************

So what would be its:
**********************************************************************************
*[uwsgi]*
*# Variables*
*base = ? *
*module = ?*
*callable = ?*
*virtualenv= %(base)/venv*
*# Generic Config*
*uid = www-data*
*gid = www-data*
*chmod-socket = 666*
*plugins = python*
*home = ?*
*pythonpath = ?*
*socket = 127.0.0.1:3031*
*logto = /var/log/uwsgi/%n.log*
**********************************************************************************

Please help.
I tried but its giving errors like unable to load flask or callable module.
**********************************************************************************
*[uwsgi]*
*# Variables*
*base = /var/www/flasksite.com*
*module = runserver*
*callable = **flasksite*
*#virtualenv=%(base)/flask*
*# Generic Config*
*uid = www-data*
*gid = www-data*
*chmod-socket = 666*
*plugins = python*
*home = %(base)/flask*
*pythonpath = %(base)*
*socket = 127.0.0.1:3031*
*logto = /var/log/uwsgi/%n.log*
**********************************************************************************

Please suggest.

Thanks

Re: [flask] uWSGI configuration for flask app

From:
Akinmayowa Akinyemi
Date:
2013-05-25 @ 16:48
Hello Kudan,
This article help me out when i was in similar straits:
http://blog.kramerapps.com/post/22551999777/flask-uwsgi-nginx-ubuntu

Regards




Akinmayowa
*Aut viam inveniam aut faciam ...*


On Sat, May 25, 2013 at 8:53 AM, Kundan Singh <ksingh.pilani@gmail.com>wrote:

> Hi... I am trying to configure my flask app using uWSGI, Nginx but i'm
> facing lot of trouble.
>
> My Flask app's structure is:
>   ************************************************************
> **********************
>  */var/www/flasksite.com*
>                      * runserver.py*  #my file having __name__ ==
> __'main'__
>                       */venv*  #virtualenv folder containing *pip install
> Flask*
>                      * /flasksite* # folder containing app files
> __init__, models.py files.
>
> 
***********************************************************************************
>
> So what would be its:
>
> 
**********************************************************************************
> *[uwsgi]*
> *# Variables*
> *base = ? *
> *module = ?*
> *callable = ?*
> *virtualenv= %(base)/venv*
> *# Generic Config*
> *uid = www-data*
> *gid = www-data*
> *chmod-socket = 666*
> *plugins = python*
> *home = ?*
> *pythonpath = ?*
> *socket = 127.0.0.1:3031*
> *logto = /var/log/uwsgi/%n.log*
>
> 
**********************************************************************************
>
> Please help.
> I tried but its giving errors like unable to load flask or callable module.
>
> 
**********************************************************************************
> *[uwsgi]*
> *# Variables*
> *base = /var/www/flasksite.com*
> *module = runserver*
> *callable = **flasksite*
> *#virtualenv=%(base)/flask*
> *# Generic Config*
> *uid = www-data*
> *gid = www-data*
> *chmod-socket = 666*
> *plugins = python*
> *home = %(base)/flask*
> *pythonpath = %(base)*
> *socket = 127.0.0.1:3031*
> *logto = /var/log/uwsgi/%n.log*
>
> 
**********************************************************************************
>
> Please suggest.
>
> Thanks
>