tstone / django-uploadify

Django integration of Uploadify jQuery plugin -- No longer maintained by tstone but accepting pull requests for continued community use
173 stars 49 forks source link

Allow uploadify settings to be overridden by project owner #3

Closed polotek closed 13 years ago

polotek commented 14 years ago

This is related to making django-uploadify more flexible and reusable. It would be nice to be able to change certain settings like the path to the static uploadify files. I don't mean to be presumptuous by making suggestions, but I don't know how familiar you are with all of the ideas around reusable apps in django.

Consider your settings file versus the one in the django-flatpages contrib app

UPLOADIFY_PATH = '%s%s' % (MEDIA_URL, 'js/uploadify/')

With this, I have to modify your app to change this setting.

FP_DEFAULT_TEMPLATE = settings.FP_DEFAULT_TEMPLATE = getattr(settings, 'FP_DEFAULT_TEMPLATE', 'flatpages/default.html')

With this I can just override the value of FP_DEFAULT_TEMPLATE right in my own settings. And the app does the right thing. Otherwise there is a sensible default set and I don't have to worry about it.