I have a python application developed on Flask. Everything works fine offline, I also successfully used the CherryPy program. Now I'm trying to deploy them to www.pythonanywhere.com.
Here is deploy.py, which I use to deploy Flask application on CherryPy
from cherrypy import wsgiserver
from appname import app
def initiate():
app_list = wsgiserver.WSGIPathInfoDispatcher({'/appname': app})
server = wsgiserver.CherryPyWSGIServer( ('http://username.pythonanywhere.com/'), app_list)
try:
server.start()
except KeyboardInterrupt:
server.stop()
print "Server initiated..."
initiate()
print "Ended"
I created a "manual configuration" application on pythonanywhere.com. Here's the configuration file (username_pythonanywhere_com_wsgi.py):
import sys
path = '/home/username/appname'
if path not in sys.path:
sys.path.append(path)
import deploy
deploy.initiate()
Now I'm sure that it "almost worked" because in the server logs I could see my message "Server started ...".
2013-09-27 09:57:16 +0000 username.pythonanywhere.com - *** Operational MODE: single process ***
Server initiated...
Now the problem is, when I try to view my application username.pyhtonanywhere.com/about, time is running out. I suppose this is caused by the wrong port when starting the CherryPy server (in deploy.py).
- , CherryPy?