title: Django - AtributeError: module object has no attribute STATIC_URL
body: <p>I have project which consists of three different apps. They use general <code>settings.py</code>:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  import os
  
  SECRET_KEY = '123456'
  
  BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  
  DEBUG = True
  
  INSTALLED_APPS = (
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'whitenoise.runserver_nostatic',
      'django.contrib.staticfiles',
      'django.contrib.sites',
      'django.contrib.humanize',
  )
  
  MIDDLEWARE_CLASSES = (
      'whitenoise.middleware.WhiteNoiseMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.locale.LocaleMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  )
  
  
  
  INTERNAL_IPS = ('127.0.0.1',)
  
  
  EMAIL_BACKEND = "sgbackend.SendGridBackend"
  SENDGRID_API_KEY = "*******"
  
  TEMPLATE_DIRS = (
      os.path.join(BASE_DIR, 'templates'),
      os.path.join(BASE_DIR, 'templates/'),
      )
  TEMPLATE_CONTEXT_PROCESSORS = (
      'django.contrib.auth.context_processors.auth',
      'django.core.context_processors.request',
      'django.core.context_processors.debug',
      'django.core.context_processors.i18n',
      'django.core.context_processors.media',
      'django.core.context_processors.static',
  )
  TEMPLATE_LOADERS = (
      'django.template.loaders.filesystem.Loader',
      'django.template.loaders.app_directories.Loader',
  )
  
  CACHES = {
      'default': {
          'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
          'LOCATION': '127.0.0.1:11211',
          'DEFAULT_MIDDLEWARE_ALIAS': 'default',
          'DEFAULT_MIDDLEWARE_SECONDS': '300',
          'DEFAULT_MIDDLEWARE_KEY_PREFIX': '',
      }
  }
  
  PASSWORD_HASHERS = (
      'django.contrib.auth.hashers.SHA1PasswordHasher',
  )
  
  STATICFILES_FINDERS = (
      'django.contrib.staticfiles.finders.FileSystemFinder',
      'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  )
  </code></pre>
  
  <p>as you can see - nothing special in there. Each app has it's additional <code>app#_settings.py</code> file which extends general <code>settings.py</code>.</p>
  
  <p>All of these apps have this (last) line in their <code>urls.py</code>:</p>
  
  <pre><code>] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  </code></pre>
  
  <p>I'm in development mode, with DEBUG set to True. APP1 and APP2 are able to run development server, while i have problem with third APP and last two days i'm trying to figure out what the heck could be the problem, but without success. When i run development server (with <code>runserver --settings=app3_settings</code>) i get this error:</p>
  
  <pre><code>AtributeError: module object has no attribute STATIC_URL
  </code></pre>
  
  <p>Here is <code>app3_settings.py</code>: (app1 and app2 have pretty similar settings, almost no difference)</p>
  
  <pre><code># -*- coding: utf-8 -*-
  from settings import * 
  
  SECRET_KEY = '*************************************************'
  
  ALLOWED_HOSTS = [
      'localhost', 
      '127.0.0.1',
      ]
  
  INSTALLED_APPS += (
      'storages',
      'app3',
      'el_pagination',
      'debug_toolbar',
  )
  
  ROOT_URLCONF = 'app3.urls'
  
  WSGI_APPLICATION = 'app3.wsgi.application'
  
  DEFAULT_FROM_EMAIL = 'web@example.com'
  
  MANAGERS = ADMINS
  
  CACHES = {
      'default': {
          'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
          'LOCATION': '127.0.0.1:11211',
          'DEFAULT_MIDDLEWARE_ALIAS': 'default',
          'DEFAULT_MIDDLEWARE_SECONDS': '300',
          'DEFAULT_MIDDLEWARE_KEY_PREFIX': '',
      }
  }
  
  PASSWORD_HASHERS = (
      'django.contrib.auth.hashers.SHA1PasswordHasher',
  )
  
  
  # AMAZON S3 &amp; CLOUDFRONT SERVING MEDIA FILES
  AWS_S3_HOST = 's3.eu-central-1.amazonaws.com'
  AWS_STORAGE_BUCKET_NAME = 'mybucket'
  AWS_CLOUDFRONT_DOMAIN = 'example.cloudfront.net'
  AWS_ACCESS_KEY_ID = "*************"
  AWS_SECRET_ACCESS_KEY = "************************"
  MEDIAFILES_LOCATION = 'app3/media'
  MEDIA_ROOT = '/%s/' % MEDIAFILES_LOCATION
  MEDIA_URL = '//%s/%s/' % (AWS_CLOUDFRONT_DOMAIN, MEDIAFILES_LOCATION)
  DEFAULT_FILE_STORAGE = 'app3.custom_storages.MediaStorage'
  
  # WHITENOISE SERVING STATIC FILES
  STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
  STATIC_ROOT = os.path.join(BASE_DIR, 'project/static/app3') 
  STATIC_URL = '/static/'
  </code></pre>
  
  <p>As you can see i have declared STATIC_URL, STATIC_ROOT, MEDIA_URL and MEDIA_ROOT correctly. I emphasize again - <strong>APP1 &amp; APP2 use absolutely the same concept, but i do not get this error while trying to run development server with them</strong>, so i don't get this.</p>
  
  <p>I tried to copy this part of <code>app3_settings.py</code> to <code>settings.py</code>:</p>
  
  <pre><code># AMAZON S3 &amp; CLOUDFRONT SERVING MEDIA FILES
  AWS_S3_HOST = 's3.eu-central-1.amazonaws.com'
  AWS_STORAGE_BUCKET_NAME = 'mybucket'
  AWS_CLOUDFRONT_DOMAIN = 'example.cloudfront.net'
  AWS_ACCESS_KEY_ID = "*************"
  AWS_SECRET_ACCESS_KEY = "************************"
  MEDIAFILES_LOCATION = 'app3/media'
  MEDIA_ROOT = '/%s/' % MEDIAFILES_LOCATION
  MEDIA_URL = '//%s/%s/' % (AWS_CLOUDFRONT_DOMAIN, MEDIAFILES_LOCATION)
  DEFAULT_FILE_STORAGE = 'app3.custom_storages.MediaStorage'
  
  # WHITENOISE SERVING STATIC FILES
  STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
  STATIC_ROOT = os.path.join(BASE_DIR, 'project/static/app3') 
  STATIC_URL = '/static/'
  </code></pre>
  
  <p>and then server is able to start. But i'm not sure why should i have to repeat these lines in <code>settings.py</code> and in <code>app#_settings.py</code> when app1 and app2 use same settings and they work with no problem.</p>
  
  <p>If it matters, here is <code>manage.py</code>:</p>
  
  <pre><code>#!/usr/bin/env python
  import os
  import sys
  
  if __name__ == "__main__":
      os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
  
      from django.core.management import execute_from_command_line
  
      execute_from_command_line(sys.argv)
  </code></pre>
  
  <p>Also, i have separate <code>wsgi.py</code> for each app and it looks like this ('app#_settings' is the only difference between apps):</p>
  
  <pre><code>import os
  import sys
  from whitenoise.django import DjangoWhiteNoise
  sys.path.append('/home/user/public_html/project')
  
  os.environ['DJANGO_SETTINGS_MODULE'] = 'app#_settings'
  
  from django.core.wsgi import get_wsgi_application
  application = get_wsgi_application()
  application = DjangoWhiteNoise(application)
  </code></pre>