from pkg_resources import get_distribution, DistributionNotFound

try:
    __version__ = get_distribution(__name__).version
except DistributionNotFound:
    # package is not installed
    __version__ = None

from pkg_resources import get_distribution, DistributionNotFound

try:
    __version__ = get_distribution("django-configurations").version
except DistributionNotFound:
    # package is not installed
    __version__ = None

use package name in get_distribution function call