Ahmed Z. Ahmed Z. - 8 days ago 6
Python Question

Django server stuck on Beanstalkd

I'm trying to setup a django server with existing code. But I seemed to be stuck on this while trying to start server using

python manage.py runserver


this the traceback:

(camdyvirtualenv) Mac-mini-3:big-picture-api Sqooge_Ahmed$ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
settings.INSTALLED_APPS
File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
self._setup(name)
File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
self._wrapped = Settings(settings_module)
File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/Camdy-APIs/big-picture-api/bigpicture/settings.py", line 5, in <module>
from pystalkd.Beanstalkd import Connection as beanstalkdConnect
File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/pystalkd/__init__.py", line 20, in <module>
from . import Beanstalkd, Job
File "/Users/Sqooge_Ahmed/Documents/Django/camdyvirtualenv/lib/python2.7/site-packages/pystalkd/Beanstalkd.py", line 156
def send_command(self, command, *args, ok_status=None, error_status=None):
^
SyntaxError: invalid syntax

Answer

In Python 2 you should to set default arguments before *args:

def send_command(self, command, ok_status=None, error_status=None, *args):
Comments