I have a shared hosting from Namecheap ( No ssh access). There I can run any python file in the CGI-bin directory when I type the full path including the .py extension. I want to know how to run a flask app in such an environment. Should I change the .htaccess or make a .cgi or fcgi or wsgi? I am not sure what these are or what they do. If someone can explain these too.
Check out http://flask.pocoo.org/docs/deploying/cgi/
If your CGI-app is available at http://example.com/cgi-bin/myapp.py, you have to put the following in a .htaccess (assuming you're using Apache) to make the app available at http://example.com/:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f # Don't interfere with static files
RewriteRule ^(.*)$ /cgi-bin/myapp.py/$1 [L]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With