Pyramid INI files can contain arbitrary configuration entries , so why not include a flag in your files that distinguishes between production and deployment deployments?
I would do it like this: in your .ini file.
[app:main]
production_deployment = True # Set to False in your development .ini file
Pass this value to the Pyramid configurator:
def main(global_config, **settings):
from pyramid.settings import asbool
production_deployment = asbool(settings.get(
'production_deployment', 'false'))
settings['production_deployment'] = production_deployment
config = Configurator(settings=settings)
. , :
settings = request.registry.settings
if settings['production_deployment']:
; Google Analytics, .. , , ..