On Tue, Mar 5, 2013 at 1:55 PM, Dave Murphy <d...@schwuk.com> wrote: > On Sunday, March 3, 2013 4:45:56 PM UTC, Bruno Girin wrote: > >> Patrick solved that problem by separating different config elements in >> different files but this implies that juju'ised applications would need to >> follow the same structure. Is that a good idea? > > > If you're aiming for a PaaS-style charm for Django, then trying to emulate > The Twelve-Factor App [1] and it's opinions on configuration [2] would be a > good starting point. Basically, if there are things specific to the > environment then they should be in environment variables, not in generated > or modified config files. > >
+1 - but Django doesn't support env vars overriding settings out of the box (although configglue does enable this) which means forcing people using the charm to update their settings (rather than just encouraging good practise). That said, it might be a small (and worthwhile) thing to ask of people wanting to use the charm. (ie. to use this charm, your settings need to read the following env vars...) If not, writing a local_settings.py that overrides the required settings from the env may work: local_settings.py: {{{ import os from userproject.settings import * LANGUAGE_CODE = os.environ['DJANGO_LANGUAGE_CODE'] ... }}} Are there other better options that wouldn't force people to change their code to use the charm? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.