Re: Support SECRET_KEY and Database creds as callables

2015-01-25 Thread Riccardo Di Virgilio
sorry the code you need to write with my solution in your settings file would be class Settings(object): @property def SECRET_KEY(self): if self.DEBUG: return "abcd" return "12345" On Sunday, January 25, 2015 at 2:38:29 PM UTC+1,

Re: Support SECRET_KEY and Database creds as callables

2015-01-25 Thread Riccardo Di Virgilio
What you can try to do without modifying django code is to use custom settings class, which is a documented feature. https://docs.djangoproject.com/en/1.7/topics/settings/#custom-default-settings I'm doing that for my application, using a class that is using @property decorator to build dynamic

lazy_import_string

2015-01-24 Thread Riccardo Di Virgilio
Hi, I'm riccardo, currently working at Wolfram Reasearch Inc, I've done some contributions in the past, refactoring django.contrib.gis.measure In order to speed up loading time of my django application I'm using this code, which I think it can be inserted inside django.utils.module_loading th