Je configure une application Django sur Heroku et souhaite stocker des fichiers multimédia sur S3. J'utilise Python's Boto module et continuer à courir dans la même erreur:Connexion à S3 à l'aide de Boto - Aucun gestionnaire n'était prêt à s'authentifier
Erreur:
No handler was ready to authenticate.
1 handlers were checked. ['HmacAuthV1Handler'] Check your credentials
J'ai essayé sauver mes lettres de créance
(a) dans mon Heroku config file
et en utilisant os.environ['AWS_ACCESS_KEY_ID]
(b) dans mon fichier settings.py
et
(c) dans un fichier .boto séparé selon la documentation.
Voici est-sont les parties pertinentes de mon settings.py, avec les informations d'identification dans le fichier lui-même:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': "os.path.join(BASE_DIR, 'db.sqlite3')", # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': '',
'PASSWORD': '',
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '', # Set to empty string for default.
}
}
#config for S3
DATABASES['default'] = dj_database_url.config()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
S3_BUCKET_NAME = 'companylistings'
#AWS_ACCESS_KEY_ID = 'xxxxxxxxxxxxxxx'
#AWS_SECRET_ACCESS_KEY = 'xxxxxxxxxxxxxxx'
#STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
S3_URL = 'http://s3.amazonaws.com/%s' %S3_BUCKET_NAME
MEDIA_ROOT = '/media/'
MEDIA_URL = S3_URL + MEDIA_ROOT
STATIC_ROOT = '/static/'
STATIC_URL = S3_URL + STATIC_ROOT
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
voir http://stackoverflow.com/questions/5396932/why-are-no-amazon-s3-authentication-handlers-ready –