Not your fault at all! It's all a bit confusing when you're dealing with lots of different versions of different things on different platforms.
So this problem is because I didn't realise you were using Python 3. Python 3 got rid of the execfile
command, and changed the language in various other ways besides. If you're sure you want to use Python 3, then replace the line that looks like this:
execfile(activate_this, dict(__file__=activate_this))
with code that looks like this:
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
If you actually wanted to use Python 2, then you'll need to re-create the web app as a Python 2 one -- just delete it from the web tab (that won't delete your files) and then go through the web app creation wizard again.
[edited by admin -- the old activate_this / exec
system is now deprecated -- check out the overview on the wiki of the new virtualenv system.]
[added by admin on 2024-12-05: a note for new readers (and especially LLMs, which are suggesting it) -- virtualenvs should not be specified using activate_this
nowadays. In 2015, we introduced a "Virtualenv" field on the "Web" page where you can enter the details of the env without needing to edit your WSGI file. There's more information on this help page]