Yes and yes,
here are my settings in settings.py

# Storage Settings
DEFAULT_FILE_STORAGE = 'libs.storages.S3Storage.S3Storage'
AWS_ACCESS_KEY_ID='xxx'
AWS_SECRET_ACCESS_KEY='xxx'
AWS_STORAGE_BUCKET_NAME='userprofile'
from S3 import CallingFormat
AWS_CALLING_FORMAT=CallingFormat.SUBDOMAIN
AWS_HEADERS = {
    'Expires': 'Sat, 10 Jan 2049 00:00:00 GMT',
    'Cache-Control': 'max-age=86400',
    }
#

and I also verified that I have a bucket called "userprofile" in my Amazon
account.
In the DB I have
mysql> select * from userprofile_avatar;
+----+---------------------+---------+---------------------+-------+
| id | image               | user_id | date                | valid |
+----+---------------------+---------+---------------------+-------+
|  4 | userprofile/cs1.jpg |       2 | 2009-01-19 13:46:12 |     0 |
+----+---------------------+---------+---------------------+-------+

But I am still getting the exception saying the backend doesn't support
absolute paths.
In django/db/models/fields/files.py line 52 _get_path
  return self.storage.path(self.name)

and my self.name is userprofile/cs1.jpg

Any suggestions?
-Aaron










On Mon, Jan 19, 2009 at 4:22 PM, Merrick <merr...@gmail.com> wrote:

>
> I am using S3Storage with an imagefield successfully. It sounds like
> you have not specified the storage engine and keys etc... in
> settings.py as creecode pointed out.
>
> I recall testing that the directory will be created on the fly if it
> does not exist.
>
> On Jan 19, 12:40 pm, creecode <creec...@gmail.com> wrote:
> > Hello Aaron,
> >
> > I can confirm that it can work.  I'm using it but I don't know enough
> > to diagnose your problem.
> >
> > Have you created the userprofile "directory" in your S3 bucket?
> >
> > Have you added the following to your settings.py?
> >
> > DEFAULT_FILE_STORAGE = 'S3Storage.S3Storage'
> >
> > AWS_ACCESS_KEY_ID
> > AWS_SECRET_ACCESS_KEY
> > AWS_STORAGE_BUCKET_NAME
> > AWS_CALLING_FORMAT
> >
> > Have you installed any software S3Storage depends on?
> >
> > On Jan 19, 8:02 am, "Aaron Lee" <waifun...@gmail.com> wrote:
> >
> > > So I guess S3Storage doesn't work with ImageField? Can anyone confirm
> that?
> >
> > Toodle-loooooooooooo.............
> > creecode
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to