I've been working on this side project that's effectively a replacement for Django's default FileField
and ImageField
classes. More of a thin wrapper really, it lets you change this:
attachment = models.FileField(upload_to="attachments")
image = models.ImageField(
upload_to="images",
width_field="image_width",
height_field="image_height"
)
into this:
attachment = EncryptedFileField(upload_to="attachments")
image = EncryptedImageField(
upload_to="images",
width_field="image_width",
height_field="image_height"
)
and magically Encrypt All The Things.
The thing is, while it works well so far, and I have tests for it, packaging is still troublesome.
Specifically:
- I don't know how to run the tests outside of the demo. You need to
cd
intodemo
and run./manage.py test
and there has to be a symlink from that directory to../django_encrypted_filefield
. This can't be the "right" way to do this... right? - I think I've got
setup.py
working as I can dopip install -e git+...
and things work just fine, but I don't think thedemo
should be included, right? But if I exclude it, what about the tests? - Ideally, I'd like to setup tox to do the usual pep8 & unit test run, but I don't know how to do that for a project that's Django-dependent.
TL;DR: Can someone point me to a simple django module that does tests & packaging "right"?