[Flask] Deploying on httpd and mod_wsgi

Craig Amundsen amundsen.craig at gene.com
Wed Sep 21 18:09:33 EDT 2016


Hello -

I have written an app based on the example app in the Grinberg book. It
works great running on the dev server on my laptop. I'm now trying to
deploy it on a CentOS 7 machine running httpd with mod_wsgi.

I'm not having much luck getting it to start. According to all the
configuration pages I've read, app_name.wsgi should look like this

import sys
sys.path.insert(0, "/var/www/app_name")
from app_name import app as application

If I try running that by hand I get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named LCD

The structure of the app_name directory looks like this:

app_name
|---> app
      |---> __init__.py
            decorators.py
            main/
            other things you'd expect to see
      config.py
      app_name.wsgi
      manage.py
      tests/, migrations/, etc

I suspect that this is because in the example app from the book, there is
no __init__.py file in app_name directory.

Can anyone point me in the proper direction to get this app to start up
properly?

Thanks,
- Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160921/1143d872/attachment.html>


More information about the Flask mailing list