title: ImproperlyConfigured: Error importing module django.middleware.cache.FetchFromCacheMiddlewaredjango.middleware.clickjacking:
body: <p>I am trying first time to deploy the app on openshift. The code is using Python 2.7, Django 1.6, MySQL Server 5.6.
  I have got the cloned default code on C:\Users\welcome\resume\wsgi\openshift path.</p>
  
  <p>Now, as per <a href="https://www.openshift.com/developers/deploying-and-building-applications" rel="nofollow">https://www.openshift.com/developers/deploying-and-building-applications</a> link, first we need to run our code locally. After that we can push the code to openshift.</p>
  
  <p>From my understanding, we need to add our code files to this folder, and make the suitable changes in the settings.py, setup.py etc as per the requirement.</p>
  
  <p>NOTE: I have not done any changes in wsgi.py file </p>
  
  <p>While trying to run the code locally, I am encountering the error:   </p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Python27\lib\wsgiref\handlers.py", line 85, in run
      self.result = application(self.environ, self.start_response)
    File "C:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", l
  ine 67, in __call__
      return self.application(environ, start_response)
    File "C:\Python27\lib\site-packages\django\core\handlers\wsgi.py", line 187, i
  n __call__
      self.load_middleware()
    File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 47, in
   load_middleware
      mw_class = import_by_path(middleware_path)
    File "C:\Python27\lib\site-packages\django\utils\module_loading.py", line 26,
  in import_by_path
      sys.exc_info()[2])
    File "C:\Python27\lib\site-packages\django\utils\module_loading.py", line 21,
  in import_by_path
      module = import_module(module_path)
    File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 40, in im
  port_module
      __import__(name)
  ImproperlyConfigured: Error importing module django.middleware.cache.FetchFromCa
  cheMiddlewaredjango.middleware.clickjacking: "No module named FetchFromCacheMidd
  lewaredjango.middleware.clickjacking"
  [06/Aug/2014 12:13:33] "GET / HTTP/1.1" 500 59
  Traceback (most recent call last):
    File "C:\Python27\lib\wsgiref\handlers.py", line 85, in run
      self.result = application(self.environ, self.start_response)
    File "C:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", l
  ine 67, in __call__
      return self.application(environ, start_response)
    File "C:\Python27\lib\site-packages\django\core\handlers\wsgi.py", line 187, i
  n __call__
      self.load_middleware()
    File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 47, in
   load_middleware
      mw_class = import_by_path(middleware_path)
    File "C:\Python27\lib\site-packages\django\utils\module_loading.py", line 26,
  in import_by_path
      sys.exc_info()[2])
    File "C:\Python27\lib\site-packages\django\utils\module_loading.py", line 21,
  in import_by_path
      module = import_module(module_path)
    File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 40, in im
  port_module
      __import__(name)
  ImproperlyConfigured: Error importing module django.middleware.cache.FetchFromCa
  cheMiddlewaredjango.middleware.clickjacking: "No module named FetchFromCacheMidd
  lewaredjango.middleware.clickjacking"
  </code></pre>
  
  <p>My Settings.py is :</p>
  
  <pre><code># -*- coding: utf-8 -*-
  # Django settings for OpenShift project.
  import imp, os
  from django.middleware.clickjacking import XFrameOptionsMiddleware
  from django.middleware.common import CommonMiddleware
  
  
  ON_OPENSHIFT = False
  if os.environ.has_key('OPENSHIFT_REPO_DIR'):
      ON_OPENSHIFT = True
  
  PROJECT_DIR = os.path.dirname(os.path.realpath(__file__))
  if ON_OPENSHIFT:
      DEBUG = bool(os.environ.get('DEBUG', False))
      if DEBUG:
          print("WARNING: The DEBUG environment is set to True.")
  else:
      DEBUG = True
  TEMPLATE_DEBUG = DEBUG
  
  ADMINS = (
      # ('Your Name', 'your_email@example.com'),
  )
  MANAGERS = ADMINS
  
  if ON_OPENSHIFT:
      # os.environ['OPENSHIFT_MYSQL_DB_*'] variables can be used with databases created
      # with rhc cartridge add (see /README in this git repo)
      DATABASES = {
          'default': {
              'ENGINE': 'django.db.backends.sqlite3',  # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
              'NAME': os.path.join(os.environ['OPENSHIFT_DATA_DIR'], 'sqlite3.db'),  # Or path to database file if using sqlite3.
              'USER': '',                      # Not used with sqlite3.
              'PASSWORD': '',                  # Not used with sqlite3.
              'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
              'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
          }
      }
  else:
      DATABASES = {
          'default': {
              'ENGINE': 'django.db.backends.sqlite3',  # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
              'NAME': os.path.join(PROJECT_DIR, 'sqlite3.db'),  # Or path to database file if using sqlite3.
              'USER': '',                      # Not used with sqlite3.
              'PASSWORD': '',                  # Not used with sqlite3.
              'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
              'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
          }
      }
  
  
  TIME_ZONE = 'America/Chicago'
  
  # Language code for this installation. All choices can be found here:
  # http://www.i18nguy.com/unicode/language-identifiers.html
  LANGUAGE_CODE = 'en-us'
  
  SITE_ID = 1
  
  # If you set this to False, Django will make some optimizations so as not
  # to load the internationalization machinery.
  USE_I18N = True
  
  # If you set this to False, Django will not format dates, numbers and
  # calendars according to the current locale
  USE_L10N = True
  
  # Absolute filesystem path to the directory that will hold user-uploaded files.
  # Example: "/home/media/media.lawrence.com/media/"
  MEDIA_ROOT = os.environ.get('OPENSHIFT_DATA_DIR', '')
  
  # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  # trailing slash.
  # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  MEDIA_URL = ''
  
  # Absolute path to the directory static files should be collected to.
  # Don't put anything in this directory yourself; store your static files
  # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  # Example: "/home/media/media.lawrence.com/static/"
  STATIC_ROOT = os.path.join(PROJECT_DIR, '..', 'static')
  
  # URL prefix for static files.
  # Example: "http://media.lawrence.com/static/"
  STATIC_URL = '/static/'
  
  # URL prefix for admin static files -- CSS, JavaScript and images.
  # Make sure to use a trailing slash.
  # Examples: "http://foo.com/static/admin/", "/static/admin/".
  ADMIN_MEDIA_PREFIX = '/static/admin/'
  
  # Additional locations of static files
  STATICFILES_DIRS = (
      # Put strings here, like "/home/html/static" or "C:/www/django/static".
      # Always use forward slashes, even on Windows.
      # Don't forget to use absolute paths, not relative paths.
  )
  
  # List of finder classes that know how to find static files in
  # various locations.
  STATICFILES_FINDERS = (
      'django.contrib.staticfiles.finders.FileSystemFinder',
      'django.contrib.staticfiles.finders.AppDirectoriesFinder',
      #'django.contrib.staticfiles.finders.DefaultStorageFinder',
  )
  
  # Make a dictionary of default keys
  default_keys = { 'SECRET_KEY': 'vm4rl5*ymb@2&amp;d_(gc$gb-^twq9w(u69hi--%$5xrh!xk(t%hw' }
  
  # Replace default keys with dynamic values if we are in OpenShift
  use_keys = default_keys
  if ON_OPENSHIFT:
      imp.find_module('openshiftlibs')
      import openshiftlibs
      use_keys = openshiftlibs.openshift_secure(default_keys)
  
  # Make this unique, and don't share it with anybody.
  SECRET_KEY = use_keys['SECRET_KEY']
  
  # List of callables that know how to import templates from various sources.
  TEMPLATE_LOADERS = (
      'django.template.loaders.filesystem.Loader',
      'django.template.loaders.app_directories.Loader',
      #'django.template.loaders.eggs.Loader',
  )
  
  MIDDLEWARE_CLASSES = (
      'django.middleware.common.CommonMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
  
  'django.middleware.clickjacking.XFrameOptionsMiddleware',
  'django.middleware.cache.FetchFromCacheMiddlewaredjango.middleware.clickjacking',
      )
  
  ROOT_URLCONF = 'openshift.urls'
  
  TEMPLATE_DIRS = (
      # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
      # Always use forward slashes, even on Windows.
      # Don't forget to use absolute paths, not relative paths.
      os.path.join(PROJECT_DIR, 'templates'),
  )
  
  
  INSTALLED_APPS = (
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.sites',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      # Uncomment the next line to enable the admin:
      'django.contrib.admin',
      'openshift',
      # Uncomment the next line to enable admin documentation:
      # 'django.contrib.admindocs',
  )
  
  
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'handlers': {
          'mail_admins': {
              'level': 'ERROR',
              'class': 'django.utils.log.AdminEmailHandler'
          }
      },
      'loggers': {
          'django.request': {
              'handlers': ['mail_admins'],
              'level': 'ERROR',
              'propagate': True,
          },
      }
  }
  </code></pre>
  
  <p>Please tell where am i going wrong. Also, if possible guide on as to where to make changes and in which files and where to exactly copy the code. </p>