You were exactly right, it was a sloppy mistake. Thanks for looking at this. Time to move on to the next error I just got.
On Sep 25, 3:40 pm, Brian McKeever <kee...@gmail.com> wrote: > I'd guess that you didn't set AWS_SECRET_ACCESS_KEY correctly in your > settings. > > http://code.welldev.org/django-storages/wiki/S3Storage > > On Sep 25, 2:12 pm, Nick <nickt...@gmail.com> wrote: > > > something like this? > > > Environment: > > > Request Method: POST > > Request URL:http://localhost:8000/admin/StoryWall/statefair/16/ > > Django Version: 1.2 pre-alpha SVN-11434 > > Python Version: 2.5.4 > > Installed Applications: > > ['django.contrib.auth', > > 'django.contrib.contenttypes', > > 'django.contrib.sessions', > > 'django.contrib.sites', > > 'django.contrib.admin', > > 'django.contrib.admin', > > 'MMprojects.StoryWall'] > > Installed Middleware: > > ('django.middleware.common.CommonMiddleware', > > 'django.contrib.sessions.middleware.SessionMiddleware', > > 'django.contrib.auth.middleware.AuthenticationMiddleware') > > > Traceback: > > File "C:\Python25\lib\site-packages\django\core\handlers\base.py" in > > get_response > > 92. response = callback(request, *callback_args, > > **callback_kwargs) > > File "C:\Python25\lib\site-packages\django\contrib\admin\options.py" > > in wrapper > > 226. return self.admin_site.admin_view(view)(*args, > > **kwargs) > > File "C:\Python25\lib\site-packages\django\views\decorators\cache.py" > > in _wrapped_view_func > > 44. response = view_func(request, *args, **kwargs) > > File "C:\Python25\lib\site-packages\django\contrib\admin\sites.py" in > > inner > > 186. return view(request, *args, **kwargs) > > File "C:\Python25\lib\site-packages\django\db\transaction.py" in > > _commit_on_success > > 240. res = func(*args, **kw) > > File "C:\Python25\lib\site-packages\django\contrib\admin\options.py" > > in change_view > > 830. self.save_model(request, new_object, form, > > change=True) > > File "C:\Python25\lib\site-packages\django\contrib\admin\options.py" > > in save_model > > 557. obj.save() > > File "C:\Python25\lib\site-packages\django\db\models\base.py" in save > > 410. self.save_base(force_insert=force_insert, > > force_update=force_update) > > File "C:\Python25\lib\site-packages\django\db\models\base.py" in > > save_base > > 473. values = [(f, None, (raw and getattr > > (self, f.attname) or f.pre_save(self, False))) for f in non_pks] > > File "C:\Python25\lib\site-packages\django\db\models\fields\files.py" > > in pre_save > > 252. file.save(file.name, file, save=False) > > File "C:\Python25\lib\site-packages\django\db\models\fields\files.py" > > in save > > 91. self.name = self.storage.save(name, content) > > File "C:\Python25\lib\site-packages\django\core\files\storage.py" in > > save > > 46. name = self.get_available_name(name) > > File "C:\Python25\lib\site-packages\django\core\files\storage.py" in > > get_available_name > > 71. while self.exists(name): > > File "c:\python25\lib\site-packages\django_storages-1.0-py2.5.egg > > \backends\s3.py" in exists > > 105. response = self.connection._make_request('HEAD', > > self.bucket, name) > > File "c:\python25\lib\site-packages\django_storages-1.0-py2.5.egg > > \S3.py" in _make_request > > 273. self._add_aws_auth_header(final_headers, method, > > bucket, key, query_args) > > File "c:\python25\lib\site-packages\django_storages-1.0-py2.5.egg > > \S3.py" in _add_aws_auth_header > > 299. "AWS %s:%s" % (self.aws_access_key_id, encode > > (self.aws_secret_access_key, c_string)) > > File "c:\python25\lib\site-packages\django_storages-1.0-py2.5.egg > > \S3.py" in encode > > 84. b64_hmac = base64.encodestring(hmac.new > > (aws_secret_access_key, str, sha).digest()).strip() > > File "C:\Python25\lib\hmac.py" in new > > 121. return HMAC(key, msg, digestmod) > > File "C:\Python25\lib\hmac.py" in __init__ > > 64. if len(key) > blocksize: > > > Exception Type: TypeError at /admin/StoryWall/statefair/16/ > > Exception Value: object of type 'NoneType' has no len() > > > On Sep 25, 2:54 pm, Brian McKeever <kee...@gmail.com> wrote: > > > > A stack trace would be more useful. > > > > On Sep 25, 12:07 pm, Nick <nickt...@gmail.com> wrote: > > > > > I'm using the django-storages backends from David Larlet to upload > > > > images to s3 from inside the admin. When i try to run everything I > > > > get an error: > > > > > object of type 'NoneType' has no len() > > > > > Here is my model: > > > > > from django.db import models > > > > from django.core.files.storage import default_storage as s3_storage > > > > > class StateFair (models.Model): > > > > Content_Choices = ( > > > > ('photo', 'Photo'), > > > > ('video', 'Video'), > > > > ('text', 'Text'), > > > > ('audio', 'Audio'), > > > > ) > > > > Name = models.CharField(max_length=30, blank=False, unique=True) > > > > contentType = models.CharField('Type of Content', max_length=5, > > > > choices=Content_Choices, blank=True) > > > > thumbNailUpload = models.ImageField('Thumbnail Upload', > > > > storage=s3_storage, upload_to='/news', height_field=None, > > > > width_field=None, max_length=100, blank=True, null=True) > > > > ThumbNail = models.CharField('Thumbnail Name', max_length=50, > > > > blank=True) > > > > imageUpload = models.ImageField('Full Size Image Upload', > > > > storage=s3_storage, upload_to='/news, height_field=None, > > > > width_field=None, max_length=100, blank=True, null=True) > > > > Image = models.CharField('Image name (use jpg, png, etc.)', > > > > max_length=30, blank=True) > > > > Cutline = models.TextField('Caption or Cutline', blank=True) > > > > VideoID = models.IntegerField(max_length=30, null=True, > > > > blank=True) > > > > TextBlock = models.TextField('Text Block', blank=True) > > > > AudioID = models.CharField('Audio FileName', max_length=40, > > > > blank=True) > > > > pubDate = models.DateTimeField('updated', blank=True) > > > > > class Meta: > > > > ordering = ("?") > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---