-
-
Notifications
You must be signed in to change notification settings - Fork 866
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
In django-storages library why safe_join function is not imported in s3boto3.py file from storages.utils.py file #608
Comments
That function was moved to that file in version 1.6 Are you sure you don't have a legacy copy of django-storages hanging around somehow? |
i checked different version of django-storages like 1.4, 1.5, 1.7 on all versions i am getting the same error |
Can you post the full traceback?
… On Sep 29, 2018, at 6:20 PM, rahul6612 ***@***.***> wrote:
i checked different version of django-storages like 1.4, 1.5, 1.7 on all versions i am getting the same error
and in my python site-packages directory only one storages directory is there that contains utils.py file and s3boto3.py file
i am trying to fix it from 3 days still didn't get the solution so please help
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#608 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACJB2MUoH3dTMW0kFl_ZeClP_SmPtjW9ks5uf_IVgaJpZM4XAr8D>.
|
inside storages directory utils.py file from django.conf import settings def setting(name, default=None): def clean_name(name):
def safe_join(base, *paths):
def check_location(storage): def lookup_env(names): def get_available_overwrite_name(name, max_length):
` inside storages ->backends directory s3boto3.py file`import mimetypes from django.conf import settings as django_settings from storages.utils import ( try: boto3_version_info = tuple([int(i) for i in boto3_version.split('.')]) @deconstructible
@deconstructible
class StaticStorage(S3Boto3Storage): class MediaStorage(S3Boto3Storage): and here is my main settings.py file is MEDIAFILES_LOCATION = 'media' AWS_STORAGE_BUCKET_NAME = 'darkmachine' |
@rahul6612 did you figure this out? |
ya i got that |
I had a similar error and solved it by removing "location" from my STORAGES OPTIONS |
Currently i am using Django(version=1.8.4), django-storages(version=1.6.5) and boto3(version=1.5.35). while running the command heroku run python manage.py collectstatic i am getting this error:
from storages.utils import safe_join, setting
ImportError: cannot import name 'safe_join'
here is our safe_join function is defined in utils.py file
`def safe_join(base, *paths):
"""
A version of django.utils._os.safe_join for S3 paths.
and here we imported safe_join function in s3boto3.py file
from storages.utils import setting, safe_join
The text was updated successfully, but these errors were encountered: