Flask Snippets

Snippets are unofficial and unmaintained.

This is an archived view of user-submitted snippets. Despite being hosted on the Flask site, they are not official. No Flask maintainer has curated or checked the snippets for security, correctness, or design.

Apache hosting

Posted by Dorianux on 2012-09-20 @ 12:43 and filed in Deployment

I had problems with the default Apache wsgi-setup from the Flask docs: http://flask.pocoo.org/docs/deploying/mod_wsgi/#creating-a-wsgi-file

I simply changed the python current-working-directory in the wsgi-file to the application directory.

Now Apache is fine.

myapp.wsgi:

import sys, os
sys.path.insert (0,'/var/www/myapp')
os.chdir("/var/www/myapp")
from srv import app as application

This snippet by Dorianux can be used freely for anything you like. Consider it public domain.