I'm having a problem where urllib2.urlopen() returns "HTTP Error 403" when I invoke my code as a web app through web2py (the same code runs flawlessly when run through the pythonanywhere IDE); the link is straight http (not https). Now, I recognize this error code: when I encountered it before I realized that I had to upgrade my account to access sites not on the whitelist, and I have since done so. I speculate that the problem is that when I try to run my code in a web app the user is deemed to be an anonymous "somebody" rather than "me" (who paid for an account upgrade).
My questions then:
Is my speculation correct, or is there something else causing this error code?
Any suggestions on how to rectify this? Is there any way to get my code to "run as" me when it is accessed over the web?