import os

from django import get_version
from django.conf import settings


def pytest_report_header(config):
    return 'django: ' + get_version()


def pytest_configure():
    if not settings.configured:
        os.environ['DJANGO_SETTINGS_MODULE'] = 'base.settings'
        os.environ['DJANGO_CONFIGURATION'] = 'Testing'

import os

from django import get_version
from django.conf import settings


def pytest_report_header(config):
    return 'django: ' + get_version()


def pytest_configure():
    import dotenv
    dotenv.read_dotenv()

    if not settings.configured:
        os.environ['DJANGO_SETTINGS_MODULE'] = 'base.settings'
        os.environ['DJANGO_CONFIGURATION'] = 'Testing'

Read our .env when we test.
Read our .env when we test.

  import os
  
  from django import get_version
  from django.conf import settings
  
  
  def pytest_report_header(config):
      return 'django: ' + get_version()
  
  
  def pytest_configure():
+     import dotenv
+     dotenv.read_dotenv()
+ 
      if not settings.configured:
          os.environ['DJANGO_SETTINGS_MODULE'] = 'base.settings'
          os.environ['DJANGO_CONFIGURATION'] = 'Testing'
  
Read our .env when we test.
## Code Before:
import os

from django import get_version
from django.conf import settings


def pytest_report_header(config):
    return 'django: ' + get_version()


def pytest_configure():
    if not settings.configured:
        os.environ['DJANGO_SETTINGS_MODULE'] = 'base.settings'
        os.environ['DJANGO_CONFIGURATION'] = 'Testing'

## Instruction:
Read our .env when we test.
## Code After:
import os

from django import get_version
from django.conf import settings


def pytest_report_header(config):
    return 'django: ' + get_version()


def pytest_configure():
    import dotenv
    dotenv.read_dotenv()

    if not settings.configured:
        os.environ['DJANGO_SETTINGS_MODULE'] = 'base.settings'
        os.environ['DJANGO_CONFIGURATION'] = 'Testing'
