import os


class Config:
    """Base configuration."""

    ENV = None

    PATH = os.path.abspath(os.path.dirname(__file__))
    ROOT = os.path.dirname(PATH)
    DEBUG = False
    THREADED = False

    GOOGLE_ANALYTICS_TID = os.getenv('GOOGLE_ANALYTICS_TID')

    SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL')


class ProdConfig(Config):
    """Production configuration."""

    ENV = 'prod'


class TestConfig(Config):
    """Test configuration."""

    ENV = 'test'

    DEBUG = True
    TESTING = True

    SQLALCHEMY_DATABASE_URI = "postgresql://localhost/memegen_test"


class DevConfig(Config):
    """Development configuration."""

    ENV = 'dev'

    DEBUG = True


def get_config(name):
    assert name, "no configuration specified"

    for config in Config.__subclasses__():  # pylint: disable=no-member
        if config.ENV == name:
            return config

    assert False, "no matching configuration"

import os


class Config:
    """Base configuration."""

    ENV = None

    PATH = os.path.abspath(os.path.dirname(__file__))
    ROOT = os.path.dirname(PATH)
    DEBUG = False
    THREADED = False

    GOOGLE_ANALYTICS_TID = os.getenv('GOOGLE_ANALYTICS_TID')

    SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL')
    SQLALCHEMY_TRACK_MODIFICATIONS = False


class ProdConfig(Config):
    """Production configuration."""

    ENV = 'prod'


class TestConfig(Config):
    """Test configuration."""

    ENV = 'test'

    DEBUG = True
    TESTING = True

    SQLALCHEMY_DATABASE_URI = "postgresql://localhost/memegen_test"


class DevConfig(Config):
    """Development configuration."""

    ENV = 'dev'

    DEBUG = True


def get_config(name):
    assert name, "no configuration specified"

    for config in Config.__subclasses__():  # pylint: disable=no-member
        if config.ENV == name:
            return config

    assert False, "no matching configuration"

Disable SQLAlchemy change tracking signals
Disable SQLAlchemy change tracking signals

This is enabled by default, which currently emits a warning.
The default will be False in the future.
