Wiadomość napisana w dniu 2008-11-18, o godz. 03:29, przez mdnesvold: > > I'm writing an application that adds several app-specific settings. As > I'm developing, I'm just adding them to the end of my settings.py > file: > > MY_APP_FOO = 'foo' > MY_APP_BAR = ( > 'bar', > 'bam', > 'baz', > ) > # and so on > > So far, I have eleven such settings over 21 lines and expect to add > several more. I don't want to make any new users of this app cut-and- > paste a block of code into their settings.py just to get the app > working, especially since some are "advanced settings" and will rarely > be changed. Is there any way to specify default values for these > settings? That way, my app requires less work to set up and still > allows flexibility.
I usually add separate settings for application, then do from myapp.settings import * in main settings module. Of course, all settings have defaults (I'm doing getattr(settings, 'MY_SETTING', 'foo')) and are documented. -- We read Knuth so you don't have to. - Tim Peters Jarek Zgoda, R&D, Redefine [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---