1

I'm trying to put my first flask powered site on my digital ocean server and have followed there tutorial yet I'm getting a syntax error in my apache error log and I am unsure why.

My wsgi file

#!/usr/bin/python
activate_this = '/var/www/mysite/venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this)

import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/mysite/")

from mysite import app as application

Error Log

[Mon Jan 20 16:22:51 2014] [error] [client 86.153.31.236] SyntaxError: invalid syntax
[Mon Jan 20 16:26:16 2014] [error] [client 86.153.31.236] mod_wsgi (pid=24338,     process='', application='mysite.co.uk|'): Failed to parse WSGI script file '/var/www    /mysite/flaskr.wsgi'.
[Mon Jan 20 16:26:16 2014] [error] [client 86.153.31.236] mod_wsgi (pid=24338):     Exception occurred processing WSGI script '/var/www/mysite/flaskr.wsgi'.
[Mon Jan 20 16:26:16 2014] [error] [client 86.153.31.236]   File "/var/www/mysite    /flaskr.wsgi", line 6
[Mon Jan 20 16:26:16 2014] [error] [client 86.153.31.236]     import sys
[Mon Jan 20 16:26:16 2014] [error] [client 86.153.31.236]          ^
[Mon Jan 20 16:26:16 2014] [error] [client 86.153.31.236] SyntaxError: invalid syntax

I just don't know what to do as I have viewed others and mine seems the exact same.

1 Answer 1

3

You are missing a closing parenthesis on this line:

execfile(activate_this, dict(__file__=activate_this)

Notice how you have 2 opening parenthesis, but only 1 closing.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you that worked, its now giving me an import error in my error log saying on line 10 from mysite import app as application ImportError: No module named mysite I'm not sure why?
@RetroCoNoR: If this answer helped you resolve your original question (the incorrect parenthesis) please mark it as the answer. It seems like you have another question. If you cannot resolve it, please ask an entirely new question, rather than continuing to ask questions in comments here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.