1

我在我的应用程序设置文件中安装了 -pip install django-cumulus以及所有必要的东西。但是当我这样做时,django-admin.py syncstatic我得到了Unknown command: 'syncstatic'。你能指点我吗。我究竟做错了什么。

我关注的文档 - http://pypi.python.org/pypi/django-cumulus

我的环境细节:

Python 2.7.3
Django 1.4.2
django-cumulus 1.0.5
python-cloudfiles 1.7.10

编辑:

当我manage.py从我的项目中执行此操作时,出现以下错误

File "/home/jimit/python/environments/forkodecrm/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)   
File "/home/jimit/python/environments/forkodecrm/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
        self.execute(*args, **options.__dict__)   
File "/home/jimit/python/environments/forkodecrm/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
        output = self.handle(*args, **options)   
File "/home/jimit/python/environments/forkodecrm/local/lib/python2.7/site-packages/cumulus/management/commands/syncstatic.py", line 54, in handle
        self.sync_files()   
File "/home/jimit/python/environments/forkodecrm/local/lib/python2.7/site-packages/cumulus/management/commands/syncstatic.py", line 60, in sync_files
        servicenet=self.USE_SERVICENET)   File "/home/jimit/python/environments/forkodecrm/local/lib/python2.7/site-packages/cloudfiles/__init__.py", line 98, in get_connection
        return Connection(*args, **kwargs)   
File "/home/jimit/python/environments/forkodecrm/local/lib/python2.7/site-packages/cloudfiles/connection.py", line 84, in __init__
        raise TypeError("Incorrect or invalid arguments supplied") 
TypeError: Incorrect or invalid arguments supplied

我在我的 settings.py 中包含了以下设置

# cumulus rackspace config 

CUMULUS = {
    'USERNAME': 'myusername',
    'CUMULUS_API_KEY': 'myapikey',
    'CUMULUS_CONTAINER': 'mycontainer',
    'STATIC_CONTAINER': 'mycontainer',
    'USE_SERVICENET': False, # whether to use rackspace's internal private network
    'CUMULUS_FILTER_LIST': [] # a list of files to exclude from sync } 

DEFAULT_FILE_STORAGE = 'cumulus.storage.CloudFilesStorage' 

STATICFILES_STORAGE = 'cumulus.storage.CloudFilesStaticStorage'
4

1 回答 1

1

总而言之-您需要使用manage.py本地安装的项目,以便它可以使用适当的设置(不是django-admin.py文档中所述)。

如果TypeError未设置身份验证字段,则会引发 。

你的代码在这里:

CUMULUS = {
...
    'CUMULUS_API_KEY': 'myapikey',
    'CUMULUS_CONTAINER': 'mycontainer',
...
}

应该是(注意没有CUMULUS_前缀):

CUMULUS = {
...
    'API_KEY': 'myapikey',
    'CONTAINER': 'mycontainer',
...
}
于 2013-01-25T11:23:56.323 回答