I am completely new to both Python and Heroku... I am trying to communicate with xively.com using the python script included below.
This script seems to work fine locally-it performs its intended function when I execute 'foreman start'.
But when I deploy the app and try and open the URL provided by Heroku, the browser throws up:
404 Not Found The requested URL was not found on the server.
The corresponding entry in the Heroku log is:
heroku[router]: at=info method=GET path=/ host=...... request_id=...... fwd="....." dyno=web.1 connect=1ms service=13ms status=404 bytes=384
#script to GET and PUT data to xively.com
import os
from flask import Flask
import xively
app = Flask(__name__)
key = 'FEED_KEY'
feedid = 'FEED_ID'
print "Starting Xively tutorial script"
client = xively.XivelyAPIClient(key)
feed = client.feeds.get(feedid)
datastream = feed.datastreams.get("datastream1")
lev = datastream.current_value
client1 = xively.Client(key)
datastream = xively.Datastream(id="datastream2", current_value= lev)
client1.put('/v2/feeds/'+feedid, data={'datastreams': [datastream]})
I think it might have something to do with the absence of a statement such as:
@app.route('/')
...in the script. I have tried to fix it by including @app.route('/')
in the script but then the script just doesn't work. Am I supposed to include the site URL in the statement?
I would really appreciate any help I could get...