old_contents: import os
  import logging
  
  # Database connection settings
  _devdb = 'postgresql://postgres:postgres@localhost/rtrss_dev'
  SQLALCHEMY_DATABASE_URI = os.environ.get('OPENSHIFT_POSTGRESQL_DB_URL', _devdb)
  
  # directory to store runtime data, write access required
  _projdir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
  DATA_DIR = os.environ.get('OPENSHIFT_DATA_DIR', os.path.join(_projdir, 'data'))
  
  TRACKER_HOST = 'rutracker.org'
  
  # Timeone for the tracker times
  TZNAME = 'Europe/Moscow'
  
  DEBUG = bool(os.environ.get('DEBUG', False))
  
  LOGLEVEL = logging.INFO
  
  SECRET_KEY = os.environ.get('RTRSS_SECRET_KEY', 'development key')
  
  # Settings for torrent file storage
  _default_fsurl = 'file://{}'.format(os.path.join(DATA_DIR, 'torrents'))
  FILESTORAGE_URL = os.environ.get('RTRSS_FILESTORAGE_URL', _default_fsurl)
  GCS_PRIVATEKEY_URL = os.environ.get('RTRSS_GCS_PRIVATEKEY_URL')
  
  SERVER_NAME = os.environ.get('OPENSHIFT_APP_DNS', 'localhost:8080')
  
new_contents: import os
  import logging
  
  # Database connection settings
  _devdb = 'postgresql://postgres:postgres@localhost/rtrss_dev'
  SQLALCHEMY_DATABASE_URI = os.environ.get('OPENSHIFT_POSTGRESQL_DB_URL', _devdb)
  
  # directory to store runtime data, write access required
  _projdir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
  DATA_DIR = os.environ.get('OPENSHIFT_DATA_DIR', os.path.join(_projdir, 'data'))
  
  TRACKER_HOST = 'rutracker.org'
  
  # Timeone for the tracker times
  TZNAME = 'Europe/Moscow'
  
  DEBUG = bool(os.environ.get('DEBUG', False))
  
  LOGLEVEL = logging.INFO
  
  SECRET_KEY = os.environ.get('RTRSS_SECRET_KEY', 'development key')
  
  # Settings for torrent file storage
  _default_fsurl = 'file://{}'.format(DATA_DIR)
  FILESTORAGE_URL = os.environ.get('RTRSS_FILESTORAGE_URL', _default_fsurl)
  GCS_PRIVATEKEY_URL = os.environ.get('RTRSS_GCS_PRIVATEKEY_URL')
  
  if 'OPENSHIFT_APP_DNS' in os.environ:       # production
      SERVER_NAME = os.environ.get('OPENSHIFT_APP_DNS')
      PORT = int(os.environ.get('OPENSHIFT_PYTHON_PORT', 8080))
      IP = os.environ.get('OPENSHIFT_PYTHON_IP', '0.0.0.0')
  
  elif 'C9_HOSTNAME' in os.environ:       # Cloud9 dev environment
      SERVER_NAME = os.environ.get('C9_HOSTNAME')
      PORT = int(os.environ.get('C9_PORT', 8080))
      IP = os.environ.get('C9_IP', '0.0.0.0')
  
  else:       # Local dev environment
      SERVER_NAME = 'localhost:8080'
      PORT = '8080'
      HOST = '0.0.0.0'
  
subject: Update default path for local file storage, add environment-based host and port autoconfiguration