i'm using amazon aws s3, , trying set django app deploy on heroku , set static , media files using django-storages package (which uses boto).
my settings.py includes following:
debug = false staticfiles_finders = ( 'django.contrib.staticfiles.finders.filesystemfinder', 'django.contrib.staticfiles.finders.appdirectoriesfinder', 'django.contrib.staticfiles.finders.defaultstoragefinder', ) if not debug: default_file_storage = 'storages.backends.s3boto.s3botostorage' aws_storage_bucket_name = os.environ['aws_storage_bucket_name'] staticfiles_storage = 'storages.backends.s3boto.s3botostorage' s3_url = 'http://%s.s3.amazonaws.com/' % aws_storage_bucket_name static_url = s3_url admin_media_prefix = static_url + 'admin/' installed_apps += ( 'storages', ) when log console see if default storages set, though, i'm not getting should according django-storages getting started guide.
here's sample shell session:
>>> django.core.files.storage import default_storage >>> print default_storage.__class__ <class 'django.core.files.storage.defaultstorage'> according guide, should have got back:
>>> django.core.files.storage import default_storage >>> print default_storage.__class__ <class 's3storage.s3storage'> i have tried importing settings.py interactive shell. no luck. however, other aws settings stored fine, such s3_url, retrieving env variable , inserting amazon url.
can give me clue?
tia.
have installed boto? if boto not installed properly, django-storages set default storage class if not import boto.
Comments
Post a Comment