News for hackers. Stuff that matters.
Re:Django Best Practices by weirdcat on Sunday March 10, 2013 @07:14AM (#5351457)
I use a version of that -- a single system variable identifying the environment and a series of conditional blocks for each environment in the settings.py file:

  ENVIRONMENT = os.environ.get('ENVIRONMENT', None)
  
  if not ENVIRONMENT in ('development', 'staging', 'production'):
      raise Exception('You need to set ENVIRONMENT variable')
  
  if ENVIRONMENT == 'development':
      # ...
  elif ENVIRONMENT == 'staging':
      # ...

There are no comments on this comment yet.