old_contents: import os
  
  
  class Config:
      SECRET_KEY = os.environ.get('SECRET_KEY')
      SQLALCHEMY_COMMIT_ON_TEARDOWN = True
  
      @staticmethod
      def init_app(app):
          pass
  
  
  class DevelopmentConfig(Config):
      DEBUG = True
      SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL')
  
  
  class TestingConfig(Config):
      TESTING = True
  
      if os.environ.get('TEST_DATABASE_URL'):
          SQLALCHEMY_DATABASE_URI = os.environ.get('TEST_DATABASE_URL')
      else:
          basedir = os.path.abspath(os.path.dirname(__file__))
          SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data-test.sqlite')
  
  
  class ProductionConfig(Config):
      SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
  
      @classmethod
      def init_app(cls, app):
          pass
  
  
  class HerokuConfig(ProductionConfig):
      @classmethod
      def init_app(cls, app):
          ProductionConfig.init_app(app)
  
          # # log to stderr
          # import logging
          # from logging import StreamHandler
          # file_handler = StreamHandler()
          # file_handler.setLevel(logging.WARNING)
          # app.logger.addHandler(file_handler)
  
  config = {
      'development': DevelopmentConfig,
      'testing': TestingConfig,
      'production': ProductionConfig,
      'heroku': HerokuConfig,
  
      'default': DevelopmentConfig
  }
new_contents: import os
  
  basedir = os.path.abspath(os.path.dirname(__file__))
  
  class Config:
      SECRET_KEY = os.environ.get('SECRET_KEY')
      SQLALCHEMY_COMMIT_ON_TEARDOWN = True
  
      @staticmethod
      def init_app(app):
          pass
  
  
  class DevelopmentConfig(Config):
      DEBUG = True
  
      if os.environ.get('DEV_DATABASE_URL'):
          SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL')
      else:
          SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite')
  
  
  class TestingConfig(Config):
      TESTING = True
  
      if os.environ.get('TEST_DATABASE_URL'):
          SQLALCHEMY_DATABASE_URI = os.environ.get('TEST_DATABASE_URL')
      else:
          SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data-test.sqlite')
  
  
  class ProductionConfig(Config):
      SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
  
      @classmethod
      def init_app(cls, app):
          pass
  
  
  class HerokuConfig(ProductionConfig):
      @classmethod
      def init_app(cls, app):
          ProductionConfig.init_app(app)
  
          # # log to stderr
          # import logging
          # from logging import StreamHandler
          # file_handler = StreamHandler()
          # file_handler.setLevel(logging.WARNING)
          # app.logger.addHandler(file_handler)
  
  config = {
      'development': DevelopmentConfig,
      'testing': TestingConfig,
      'production': ProductionConfig,
      'heroku': HerokuConfig,
  
      'default': DevelopmentConfig
  }
subject: Use sqlite if no DEV_DATABASE specified in development env