Die django-storage-Dokumente empfehlen die Verwendung von boto3 zum Verwalten des statischen Dateispeichers mit S3. zu arbeiten, um diese Konfiguration zu erwarten, aber es ist err'ing ausboto3 site-packages S3Response-Syntax err auf collectstatic
requirements.txt
boto3==1.4.6
botocore==1.6.3
django-storages==1.1.4
prod.py [Einstellungen]
from .common import *
from storages.backends.s3boto import S3BotoStorage
...
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
AWS_ACCESS_KEY_ID = ENV_STR('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = ENV_STR('AWS_SECRET_ACCESS_KEY')
AWS_STORAGE_BUCKET_NAME = ENV_STR('AWS_STORAGE_BUCKET_NAME')
S3_URL = 'http://s3.amazonaws.com/%s/static/' % AWS_STORAGE_BUCKET_NAME
STATIC_URL = S3_URL
MEDIA_URL = 'http://s3.amazonaws.com/%s/media/' %
AWS_STORAGE_BUCKET_NAME
ADMIN_MEDIA_PREFIX = STATIC_URL + '/admin/'
AWS_S3_ENCRYPTION = True
AWS_IS_GZIPPED = True
aber Tests auf manage.py collectstatic runing --noinput scheitern mit einer Syntax err aus Einlagerungen Paket in Einlagerungen/backends/s3boto.py:
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_from_command_line(sys.argv)
File "/home/ubuntu/virtualenvs/venv-3.5.3/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/home/ubuntu/virtualenvs/venv-3.5.3/lib/python3.5/site-packages/django/core/management/__init__.py", line 302, in execute
settings.INSTALLED_APPS
File "/home/ubuntu/virtualenvs/venv-3.5.3/lib/python3.5/site-packages/django/conf/__init__.py", line 55, in __getattr__
self._setup(name)
File "/home/ubuntu/virtualenvs/venv-3.5.3/lib/python3.5/site-packages/django/conf/__init__.py", line 43, in _setup
self._wrapped = Settings(settings_module)
File "/home/ubuntu/virtualenvs/venv-3.5.3/lib/python3.5/site-packages/django/conf/__init__.py", line 99, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/opt/circleci/python/3.5.3/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 673, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/ubuntu/brightest-list/project/settings/prod.py", line 7, in <module>
from storages.backends.s3boto import S3BotoStorage
File "/home/ubuntu/virtualenvs/venv-3.5.3/lib/python3.5/site-packages/storages/backends/s3boto.py", line 139
except S3ResponseError, e:
^
SyntaxError: invalid syntax
laufenden Python 3. m y Anfangs Hypothese ist es eine Abhängigkeit Versionskonflikt, aber ich habe versucht, boto3 und Speicher unbrauchbar zu deinstallieren und neu zu installieren. schätze jede Anleitung oder Vorschläge, andernfalls kann ich Boto3 deinstallieren und zu Boto zurückkehren.