How to use django-photologue with Amazon S3? NotImplementedError Solution

I have a problem using Photologue application on heroku with S3 as storage for Django 1.5 media and static files.

The problem is that whenever I try to add, for example, the size of the photo in django admin I get: NotImplementedError

 Exception Value: This backend doesn't support absolute paths. 

The same applies to trying to set up a photologist using manage.py plinit .

The problem is that the photologist is trying to use the os.path method in several places (traceback):

 /app/.heroku/python/lib/python2.7/site-packages/photologue/models.py in _get_SIZE_filename return smart_str(os.path.join(self.cache_path(), 

Is there a way to use django-photologue with remote storage, Amazon S3 in particular?

+4
source share
2 answers

This fork django-photologue works great with s3. There are other improvements you can also love.

Thanks Marcos Daniel Petri , author of this fork. He kept me from many problems.

+2
source

The conflict was in the s3boto storage class, the path method was not implemented. According to the Django documentation, for non-local storage you should not use this method. The only way to solve this as a suggestion is to implement this method in the django-photologue code and change storages.backends.s3boto and add a path method.

 def url(self, name): ... def path(self, name): return None 

https://bitbucket.org/david/django-storages/src/tip/storages/backends/s3boto.py

0
source

All Articles