Django 服务器卡在 Beanstalkd 上
Django server stuck on Beanstalkd
我正在尝试使用现有代码设置 Django 服务器。但是我在尝试使用 python manage.py runserver
启动服务器时似乎被困在了这个问题上
这是回溯:
(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
在 Python 2 中你应该在 *args:
之前设置默认参数
def send_command(self, command, ok_status=None, error_status=None, *args):
我正在尝试使用现有代码设置 Django 服务器。但是我在尝试使用 python manage.py runserver
这是回溯:
(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
在 Python 2 中你应该在 *args:
之前设置默认参数def send_command(self, command, ok_status=None, error_status=None, *args):