I'm following the heroku quick start guide here: https://devcenter.heroku.com/articles/getting-started-with-python
and I'm stuck on the foreman start part. This is what my directory looks. I'm just running a basic web app. No frameworks or anything.
soapbar/
Procfile.txt
soapbar/
soapbar.py
__init__.py
venv/
Include/
Lib/
Scripts/
This is whats inside my Procfile:
web: gunicorn soapbar.soapbar:app
This is the stack trace:
09:28:54 web.1 | started with pid 34567
09:28:54 web.1 | 2014-03-20 09:28:54 [34567] [INFO] Starting gunicorn 18.0
09:28:54 web.1 | 2014-03-20 09:28:54 [34567] [INFO] Listening at: http://0.0.0.0:5000 (34567)
09:28:54 web.1 | 2014-03-20 09:28:54 [34567] [INFO] Using worker: sync
09:28:54 web.1 | 2014-03-20 09:28:54 [34570] [INFO] Booting worker with pid: 34570
09:28:54 web.1 | Failed to find application: 'soapbar.soapbar'
09:28:54 web.1 | 2014-03-20 09:28:54 [34570] [INFO] Worker exiting (pid: 34570)
09:28:54 web.1 | 2014-03-20 09:28:54 [34567] [INFO] Shutting down: Master
09:28:54 web.1 | 2014-03-20 09:28:54 [34567] [INFO] Reason: App failed to load.
09:28:54 web.1 | exited with code 4
09:28:54 system | sending SIGTERM to all processes
SIGTERM received
Please help.
This is soapbar.py:
import logging
import os
from spyne.application import Application
from spyne.decorator import srpc
from spyne.interface.wsdl import Wsdl11
from spyne.protocol.soap import Soap11
from spyne.service import ServiceBase
from spyne.model.complex import Iterable
from spyne.model.primitive import Integer
from spyne.model.primitive import String
from spyne.server.wsgi import WsgiApplication
class MessageService(ServiceBase):
@srpc(String, Integer, _returns=Iterable(String))
def send_message(msg):
yield 'Your message: %s' % msg
if __name__=='__main__':
try:
from wsgiref.simple_server import make_server
except ImportError:
print "Error: server requires Python >= 2.5"
logging.basicConfig(level=logging.INFO)
logging.getLogger('spyne.protocol.xml').setLevel(logging.DEBUG)
application = Application([MessageService], 'org.temporary.soap',
interface=Wsdl11(), in_protocol=Soap11(), out_protocol=Soap11())
port = int(os.environ.get('PORT', 5000))
server = make_server('0.0.0.0', port, WsgiApplication(application))
print "listening to http://0.0.0.0:%s" % port
print "wsdl is at: http://0.0.0.0:%s/?wsdl" % port
server.serve_forever()