[Flask] serious problems with deploying flask app to server

Matt Gushee matt at gushee.net
Tue Sep 8 19:56:49 CEST 2015


Hi, Tiger--

I used to run a Flask site with nginx & uwsgi; I can't recall any major
issues with deployment. That site is not currently up, but I'll see if I
can find the configs. Meanwhile, this is just to let you know that it
*should* work. IMHO.

--
Matt Gushee

On Sat, Sep 5, 2015 at 10:22 PM, tigernassau <tigernassau at gmail.com> wrote:

> Not sure whether it's an issue with docs or even a bug in wsgi  - what
> should be a 30 minute task is turning into 3 days!
>
> Although deploying the simple flask hello world example to a standard
> server should be a really basic task, good step by step docs are really
> lacking - we couldn't find a single specific working example and many other
> people reporting trouble on stackoverflow are dissed without solutions.
> The pocoo.org docs do not show a working complete example - this is
> making using Flask really difficult to use compared to other frameworks.
> Can we turn this example into some good step by step docs.
>
> we first tried nginx w/ uwsgi but this failed big time - somehow nginx is
> caching the non-working nginx.conf with uwsgi and couldn't clear it or even
> reset the server - so purged nginx and moved to Apache
>
> while apache is working fine for serving several other static sites with
> virtual hosts, the following flask app is failing on Apache - it's also
> caching some process so even after removing the app conf file in
> sites-enabled, we cannot restart the server - apparently some process is
> running that we cannot find or kill and requiring the whole server to come
> down.  something is seriously wrong here - not sure what the hell wsgi is
> doing.
>
> ourproject.py
> from flask import Flask
> app = Flask(__name__)
> @app.route('/')
> def hello():
>     return '<h1>Hello</h1>'
> if __name__ == "__main__":
>     app.run(debug=True, host='127.0.0.1',port='8040')
>
> ourproject.wsgi
> #  wsgi file
> import os, sys
> sys.path.insert(0,"var/www/ourproject")
> from ourproject import app as application
>
>
> # ourproject.conf
> <VirtualHost *:80>
>   ServerName ourproject.com
>   ServerAlias www.ourproject.com
>   DocumentRoot /var/www/ourproject/
>   ErrorLog /var/www/ourproject/logs/error.log
>   CustomLog /var/www/ourproject/logs/access.log combined
>
>   WSGIDaemonProcess ourproject user=www-data group=www-data threads=5
>   WSGIScriptAlias / /var/www/ourproject/ourproject.wsgi
>
>   <Directory /var/www/ourproject>
>       WSGIProcessGroup ourproject
>       WSGIApplicationGroup %{GLOBAL}
>       Order allow, deny
>       Allow from all
>   </Directory>
>
>   Alias /static /var/www/ourproject/static
> </VirtualHost>
>
> ** not sure what %{GLOBAL} should be
>
> 1,1           Top
>
>
>
> --
> Tiger Nassau, Inc.
> www.tigernassau.com
>
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20150908/d8b34a1f/attachment.html>


More information about the Flask mailing list