title: Django will not recognize a settings module
body: <p>I'm trying to set up a settings module for a Django app per <a href="https://www.rdegges.com/2011/the-perfect-django-settings-file/" rel="nofollow noreferrer">this guide</a>. </p>
  
  <p>I have the settings module created, which contains the <strong>__init__</strong>.py, common.py, and dev.py. However, when I attempt <code>python manage.py runserver --settings=settings.dev</code>, I get the import error:</p>
  
  <p><em>"No module named 'settings"</em></p>
  
  <p>If I attempt <code>python manage.py runserver --settings={APP_NAME}.settings.dev</code>, I get the import error:</p>
  
  <p><em>"No module named 'common'</em></p>
  
  <p>I feel like I'm missing something simple here, but can't seem to figure it out. Here are the contents of my files: </p>
  
  <p><strong>dev.py:</strong></p>
  
  <pre><code>from common import *
  # from os.path import join, normpath
  
  
  # DEBUG CONFIG
  DEBUG = True
  
  ALLOWED_HOSTS = []
  # END DEBUG CONFIG
  
  
  # DATABASE CONFIG
  # https://docs.djangoproject.com/en/1.10/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql',
          'NAME': 'Local instance wampmysqld64',
          'USER': '',
          'PASSWORD': '',
          'HOST': 'localhost',
          'PORT': '3306',
  
      }
  }
  # END DATABASE CONFIG
  </code></pre>
  
  <p><strong>common.py</strong>
      import os</p>
  
  <pre><code># Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = ''
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = []
  
  
  # Application definition
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'test',
  ]
  
  MIDDLEWARE = [
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  ]
  
  ROOT_URLCONF = 'API_PG.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(BASE_DIR, 'templates')]
          ,
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'PG.wsgi.application'
  
  
  
  
  
  # Password validation
  # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-          validators
  
  AUTH_PASSWORD_VALIDATORS = [
      {
          'NAME':'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
      },
      {
          'NAME':'django.contrib.auth.password_validation.MinimumLengthValidator',
      },
      {
          'NAME':'django.contrib.auth.password_validation.CommonPasswordValidator',
      },
      {
      'NAME':'django.contrib.auth.password_validation.NumericPasswordValidator',
       },
  ]
  
  
  # Internationalization
  # https://docs.djangoproject.com/en/1.10/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.10/howto/static-files/
  
  STATIC_URL = '/static/'
  </code></pre>
  
  <p><strong>manage.py:</strong></p>
  
  <pre><code>import os
  import sys
  
  if __name__ == "__main__":
      os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PG.settings.dev")
      try:
          from django.core.management import execute_from_command_line
      except ImportError:
          # The above import may fail for some other reason. Ensure that the
          # issue is really that Django is missing to avoid masking other
          # exceptions on Python 2.
          try:
              import django
          except ImportError:
              raise ImportError(
                  "Couldn't import Django. Are you sure it's installed and "
                  "available on your PYTHONPATH environment variable? Did you "
                  "forget to activate a virtual environment?"
              )
         raise
      execute_from_command_line(sys.argv)
  </code></pre>
  
  <p><strong>wsgi.py</strong></p>
  
  <pre><code>import os
  import sys
  
  root_path = os.path.abspath(os.path.split(__file__)[0])
  sys.path.insert(0, os.path.join(root_path, 'PG.settings.dev'))
  sys.path.insert(0, root_path)
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PG.settings.dev")
  
  from django.core.wsgi import get_wsgi_application
  
  application = get_wsgi_application()
  </code></pre>
  
  <p>PG is the name of the project; I've tried removing it and using just 'settings.dev' in both manage.py and wsgi.py, but with no luck.</p>
  
  <p>There is a similar thread here, but the issue seems to be different.</p>
  
  <p><strong>folder structure:</strong> <a href="https://i.stack.imgur.com/LJ3e5.png" rel="nofollow noreferrer">here</a></p>