A tour of the Django files abstraction combined with the war stories of me obtaining the django-storages packages and the trials and tribulations of a maintainer of a decently popular open source package.
mozillians • Number of contributions to urllib3 • Various small fixes to any number of projects - Django, wagtail, Twisted, requests, pip, django-countries, fastlane etc etc • Always happy to give back
• Volunteering free time, hard to find sometimes • Totally understand people getting frustrated • Constantly feel ashamed • Half the time I just delete emails about new issues and pull requests • Extremely concious of not breaking backwards compat - people are running businesses on top of this software
Lots of settings, the python driver for the backend and the Storage interface • Django provides robust tools for testing different settings - namely override_settings from django.test import TestCase, override_settings @override_settings(LOGIN_URL='/other/login/') class LoginTestCase(TestCase): def test_login(self): response = self.client.get('/sekrit/') self.assertRedirects(response, '/other/login/?next=/sekrit/')
a mess def test_new_file_modified_time(self): self.storage.preload_metadata = True name = 'test_storage_save.txt' content = ContentFile('new content') utcnow = datetime.datetime.utcnow() with mock.patch('storages.backends.s3boto.datetime') as mock_datetime: mock_datetime.utcnow.return_value = utcnow self.storage.save(name, content) self.assertEqual(self.storage.modified_time(name), parse_ts(utcnow.strftime(ISO8601))) • Why not just switch? • Have to wait for a 2.0 (i.e. soon)
Open • Documentation - absolutely critical but also critically lacking at the moment • New storages are constantly added • Just this morning an issue was opened asking about desire for Ceph, Swift and Riak backends