import pkg_resources
from django.apps import AppConfig

__version__ = pkg_resources.require("dj-stripe")[0].version

default_app_config = "djstripe.DjstripeAppConfig"


class DjstripeAppConfig(AppConfig):
    """
    An AppConfig for dj-stripe which loads system checks
    and event handlers once Django is ready.
    """

    name = "djstripe"

    def ready(self):
        import stripe

        from . import (  # noqa: Register the checks and event handlers
            checks,
            event_handlers,
        )

        # Set app info
        # https://stripe.com/docs/building-plugins#setappinfo
        stripe.set_app_info(
            "dj-stripe",
            version=__version__,
            url="https://github.com/dj-stripe/dj-stripe",
        )

import pkg_resources
from django.apps import AppConfig

__version__ = pkg_resources.get_distribution("dj-stripe").version

default_app_config = "djstripe.DjstripeAppConfig"


class DjstripeAppConfig(AppConfig):
    """
    An AppConfig for dj-stripe which loads system checks
    and event handlers once Django is ready.
    """

    name = "djstripe"

    def ready(self):
        import stripe

        from . import (  # noqa: Register the checks and event handlers
            checks,
            event_handlers,
        )

        # Set app info
        # https://stripe.com/docs/building-plugins#setappinfo
        stripe.set_app_info(
            "dj-stripe",
            version=__version__,
            url="https://github.com/dj-stripe/dj-stripe",
        )

Use pkg_resources.get_distribution instead of .require for version
Use pkg_resources.get_distribution instead of .require for version

  import pkg_resources
  from django.apps import AppConfig
  
- __version__ = pkg_resources.require("dj-stripe")[0].version
+ __version__ = pkg_resources.get_distribution("dj-stripe").version
  
  default_app_config = "djstripe.DjstripeAppConfig"
  
  
  class DjstripeAppConfig(AppConfig):
      """
      An AppConfig for dj-stripe which loads system checks
      and event handlers once Django is ready.
      """
  
      name = "djstripe"
  
      def ready(self):
          import stripe
  
          from . import (  # noqa: Register the checks and event handlers
              checks,
              event_handlers,
          )
  
          # Set app info
          # https://stripe.com/docs/building-plugins#setappinfo
          stripe.set_app_info(
              "dj-stripe",
              version=__version__,
              url="https://github.com/dj-stripe/dj-stripe",
          )
  
Use pkg_resources.get_distribution instead of .require for version
## Code Before:
import pkg_resources
from django.apps import AppConfig

__version__ = pkg_resources.require("dj-stripe")[0].version

default_app_config = "djstripe.DjstripeAppConfig"


class DjstripeAppConfig(AppConfig):
    """
    An AppConfig for dj-stripe which loads system checks
    and event handlers once Django is ready.
    """

    name = "djstripe"

    def ready(self):
        import stripe

        from . import (  # noqa: Register the checks and event handlers
            checks,
            event_handlers,
        )

        # Set app info
        # https://stripe.com/docs/building-plugins#setappinfo
        stripe.set_app_info(
            "dj-stripe",
            version=__version__,
            url="https://github.com/dj-stripe/dj-stripe",
        )

## Instruction:
Use pkg_resources.get_distribution instead of .require for version
## Code After:
import pkg_resources
from django.apps import AppConfig

__version__ = pkg_resources.get_distribution("dj-stripe").version

default_app_config = "djstripe.DjstripeAppConfig"


class DjstripeAppConfig(AppConfig):
    """
    An AppConfig for dj-stripe which loads system checks
    and event handlers once Django is ready.
    """

    name = "djstripe"

    def ready(self):
        import stripe

        from . import (  # noqa: Register the checks and event handlers
            checks,
            event_handlers,
        )

        # Set app info
        # https://stripe.com/docs/building-plugins#setappinfo
        stripe.set_app_info(
            "dj-stripe",
            version=__version__,
            url="https://github.com/dj-stripe/dj-stripe",
        )
