makinacorpus/django-paperclip — pull request #10 by fle (2014-12-13 11:59:15+00:00)
Title: Remove crispy_forms dependancy

Add a way to get rid of crispy_forms:
* Add a setting USE_CRISPY_FORMS : boolean (True by default to not break existing installations)
* Add a template _attachment_form_no_crispy.html (templatetag smartly use _attachment_form.html or _attachment_form_no_crispy.html based on USE_CRISPY_FORMS value)
* Adapt form __init__ method to not create Layout if USE_CRISPY_FORM is not used
* Remove crispy_forms from requirements in setup.py
* Raise an ImproperlyConfigured exception if USE_CRISPY_FORMS is True but module is not installed

This works well without crispy_forms but I think the code needs review (and test) for a "with crispy_forms" usage even if I tried to not break anything.