
# Import all files that define metrics. This has the effect that
# `import django_prometheus` will always instanciate all metric
# objects right away.
import django_prometheus.middleware
import django_prometheus.models

# Import pip_prometheus to export the pip metrics automatically.
import pip_prometheus

default_app_config = 'django_prometheus.apps.DjangoPrometheusConfig'


# Import all files that define metrics. This has the effect that
# `import django_prometheus` will always instanciate all metric
# objects right away.
import django_prometheus.middleware
import django_prometheus.models

# Import pip_prometheus to export the pip metrics automatically.
try:
    import pip_prometheus
except ImportError:
    # If people don't have pip, don't export anything.
    pass

default_app_config = 'django_prometheus.apps.DjangoPrometheusConfig'

Make the use of pip-prometheus optional.
Make the use of pip-prometheus optional.

  
  # Import all files that define metrics. This has the effect that
  # `import django_prometheus` will always instanciate all metric
  # objects right away.
  import django_prometheus.middleware
  import django_prometheus.models
  
  # Import pip_prometheus to export the pip metrics automatically.
+ try:
- import pip_prometheus
+     import pip_prometheus
+ except ImportError:
+     # If people don't have pip, don't export anything.
+     pass
  
  default_app_config = 'django_prometheus.apps.DjangoPrometheusConfig'
  
Make the use of pip-prometheus optional.
## Code Before:

# Import all files that define metrics. This has the effect that
# `import django_prometheus` will always instanciate all metric
# objects right away.
import django_prometheus.middleware
import django_prometheus.models

# Import pip_prometheus to export the pip metrics automatically.
import pip_prometheus

default_app_config = 'django_prometheus.apps.DjangoPrometheusConfig'

## Instruction:
Make the use of pip-prometheus optional.
## Code After:

# Import all files that define metrics. This has the effect that
# `import django_prometheus` will always instanciate all metric
# objects right away.
import django_prometheus.middleware
import django_prometheus.models

# Import pip_prometheus to export the pip metrics automatically.
try:
    import pip_prometheus
except ImportError:
    # If people don't have pip, don't export anything.
    pass

default_app_config = 'django_prometheus.apps.DjangoPrometheusConfig'
