builtins.SyntaxError File "/home/ubuntu/workspace/pset6/sentiments/application.py", line 26 return redirect (url_for("index")) ^ SyntaxError: 'return' outside function
Here's a trick that might make the API_KEY/SECRET easier to manage. Create a new file in your sentiments directory (I call mine
twitkeys). Type or copy/paste the two export commands into this file and save it. Your file will look something like
(of course your KEY and SECRET instead of whatever).
Now for the trick: before you run tweets run this:
$ . ./twitkeys. Yes that is "dot space dot slash twitkeys". I forget the technical explanation, but the first
. (dot) will put the stuff in
twitkeys into your environment.
As for the 'return outside function' error, could be as simple as a bad indent. Without seeing the code it's impossible to say.