How deploy Flask application on Webfaction?

I got it working with the following procedure: create and app named 'myapp' of type mod_wsgi 3.3/Python 2.7. Webfaction will create the following folders: myapp |- apache2 |- htdocs Webfaction will also automatically create a simple script index. Py in your htdocs directory. Check if the sample script work visiting the root of your newly created application (to do thin on Webfaction you need to "mount" the app on a website).

If it's all OK modify the script deleting the content and adding: from myapp import app as application In apache2/conf/httpd. Conf add the follwing lines: WSGIPythonPath /home/username/webapps/myapp/htdocs/ #If you do not specify the next directive the app *will* work but you will #see index.Py in the path of all subdir WSGIScriptAlias / /home/username/webapps/myapp/htdocs/index. Py AddHandler wsgi-script .

Py RewriteEngine on RewriteBase / WSGIScriptReloading On.

I got it working with the following procedure: create and app named 'myapp' of type mod_wsgi 3.3/Python 2.7. Webfaction will create the following folders: myapp |- apache2 |- htdocs Webfaction will also automatically create a simple script index. Py in your htdocs directory. Check if the sample script work visiting the root of your newly created application (to do thin on Webfaction you need to "mount" the app on a website).

If it's all OK modify the script deleting the content and adding: from myapp import app as application In apache2/conf/httpd. Conf add the follwing lines: WSGIPythonPath /home/username/webapps/myapp/htdocs/ #If you do not specify the next directive the app *will* work but you will #see index.Py in the path of all subdir WSGIScriptAlias / /home/username/webapps/myapp/htdocs/index. Py AddHandler wsgi-script .

Py RewriteEngine on RewriteBase / WSGIScriptReloading On Restart apache2.

1 note that myapp. Py must be in the python module search path. You can simply do that by adding the following code to your index.Py (if myapp.

Py is stored next to index. Py): import sys sys.path. Append('/home//webapps//htdocs') – Edwin Yip Oct 7 at 7:47 Actually, without tweaking sys.

Path, I got 500 internal error which was caused by a Python ImportError, which was indicated by the Apache log file in /home//logs/user/error_.log. – Edwin Yip Oct 7 at 7:54.

You need to set up a "Custom app (listening on port)" application. Make a note of the port that is assigned. Then in your Flask code, you need to put hardcode the port: if __name__ == __main__: app.

Run(host='0.0.0.0' port=XXXXXXX) Where you substitute XXXXXXX with the port that is randomly assigned to your custom app. Hope that helps.

Using app. Run isn't recommended for production. It's easy and will get the job done quickly, but when your project matures, you should switch to something like mod_wsgi.

– Joe Sep 10 at 17:57.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions