{"action":"created","issue":{"url":"https://api.github.com/repos/ottoyiu/django-cors-headers/issues/304","repository_url":"https://api.github.com/repos/ottoyiu/django-cors-headers","labels_url":"https://api.github.com/repos/ottoyiu/django-cors-headers/issues/304/labels{/name}","comments_url":"https://api.github.com/repos/ottoyiu/django-cors-headers/issues/304/comments","events_url":"https://api.github.com/repos/ottoyiu/django-cors-headers/issues/304/events","html_url":"https://github.com/ottoyiu/django-cors-headers/issues/304","id":314002911,"number":304,"title":"ImportError: Module \"django.middleware.common\" does not define a \"CorsMiddleware\" attribute/class","user":{"login":"santhoshdc1590","id":30614728,"avatar_url":"https://avatars2.githubusercontent.com/u/30614728?v=4","gravatar_id":"","url":"https://api.github.com/users/santhoshdc1590","html_url":"https://github.com/santhoshdc1590","followers_url":"https://api.github.com/users/santhoshdc1590/followers","following_url":"https://api.github.com/users/santhoshdc1590/following{/other_user}","gists_url":"https://api.github.com/users/santhoshdc1590/gists{/gist_id}","starred_url":"https://api.github.com/users/santhoshdc1590/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santhoshdc1590/subscriptions","organizations_url":"https://api.github.com/users/santhoshdc1590/orgs","repos_url":"https://api.github.com/users/santhoshdc1590/repos","events_url":"https://api.github.com/users/santhoshdc1590/events{/privacy}","received_events_url":"https://api.github.com/users/santhoshdc1590/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-13T07:50:13Z","updated_at":"2018-04-13T10:44:33Z","closed_at":"2018-04-13T09:13:32Z","author_association":"NONE","body":"Anyone tell me what is happening here? How do I correct this?\r\n\r\n`Python 3.5`\r\n\r\npip installed\r\n\r\n> django==1.11.1\r\n> djangorestframework==3.8.2\r\n> django-cors-headers==2.2.0\r\n\r\nThis is my settings.py\r\n```\r\n\r\n\"\"\"\r\nDjango settings for mysite project.\r\n\r\nGenerated by 'django-admin startproject' using Django 1.11.1.\r\n\r\nFor more information on this file, see\r\nhttps://docs.djangoproject.com/en/1.11/topics/settings/\r\n\r\nFor the full list of settings and their values, see\r\nhttps://docs.djangoproject.com/en/1.11/ref/settings/\r\n\"\"\"\r\n\r\nimport os\r\nfrom corsheaders.defaults import default_methods\r\nfrom corsheaders.defaults import default_headers\r\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\r\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\r\n\r\n\r\n# Quick-start development settings - unsuitable for production\r\n# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/\r\n\r\n# SECURITY WARNING: keep the secret key used in production secret!\r\nSECRET_KEY = '1+fkbb#o$j3&2xc=90k(cn^^41$^=5$w9#3-3frm2y4cz$%2qy'\r\n\r\n# SECURITY WARNING: don't run with debug turned on in production!\r\nDEBUG = True\r\n\r\nALLOWED_HOSTS = ['*']\r\n\r\n\r\n# Application definition\r\n\r\nINSTALLED_APPS = [\r\n    'django.contrib.auth',\r\n    'django.contrib.contenttypes',\r\n    'mysite.myapp',\r\n    'corsheaders',\r\n]\r\n\r\nMIDDLEWARE = [\r\n    'corsheaders.middleware.CorsMiddleware',\r\n    'django.middleware.common.CorsMiddleware',\r\n]\r\n\r\nROOT_URLCONF = 'mysite.urls'\r\n\r\nTEMPLATES = [\r\n    {\r\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\r\n        'DIRS': [],\r\n        'APP_DIRS': True,\r\n        'OPTIONS': {\r\n            'context_processors': [\r\n                'django.template.context_processors.debug',\r\n                'django.template.context_processors.request',\r\n            ],\r\n        },\r\n    },\r\n]\r\n\r\nMIDDLEWARE_CLASSES = [\r\n   \r\n    'corsheaders.middleware.CorsMiddleware',\r\n    'django.middleware.csrf.CsrfViewMiddleware',\r\n    'corsheaders.middleware.CorsPostCsrfMiddleware',\r\n]\r\n\r\nWSGI_APPLICATION = 'mysite.wsgi.application'\r\n\r\nCORS_ALLOW_METHODS = default_methods + (\r\n    'POKE',\r\n)\r\n\r\nCORS_ALLOW_HEADERS = default_headers + (\r\n    'my-custom-header',\r\n)\r\n\r\n# Database\r\n# https://docs.djangoproject.com/en/1.11/ref/settings/#databases\r\n\r\nDATABASES = {}\r\n\r\n# Password validation\r\n# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators\r\n\r\nAUTH_PASSWORD_VALIDATORS = []\r\n\r\nCORS_ORIGIN_ALLOW_ALL = True\r\n# Internationalization\r\n# https://docs.djangoproject.com/en/1.11/topics/i18n/\r\n\r\nLANGUAGE_CODE = 'en-us'\r\n\r\nTIME_ZONE = 'UTC'\r\n\r\nUSE_I18N = True\r\n\r\nUSE_L10N = True\r\n\r\nUSE_TZ = True\r\n\r\n# Static files (CSS, JavaScript, Images)\r\n# https://docs.djangoproject.com/en/1.11/howto/static-files/\r\n\r\nSTATIC_URL = '/static/'\r\n```\r\n\r\nThis is the Traceback I'm getting\r\n\r\n> Failed to execute script function Traceback (most recent call last): \r\n> File \"site-packages/django/utils/module_loading.py\", \r\n> line 23, in import_string AttributeError: module 'django.middleware.common' has no attribute 'CorsMiddleware' \r\n> During handling of the above exception, another exception occurred: \r\n> Traceback (most recent call last): \r\n> File \"function.py\", line 2, in <module> File \"/app/cloudfn/pip-cache-3.5/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py\", \r\n> line 631, in exec_module File \"mysite/wsgi.py\", \r\n> line 16, in <module> File \"site-packages/django/core/wsgi.py\", \r\n> line 14, in get_wsgi_application File \"site-packages/django/core/handlers/wsgi.py\", \r\n> line 151, in __init__ File \"site-packages/django/core/handlers/base.py\", \r\n> line 80, in load_middleware File \"site-packages/django/utils/module_loading.py\", \r\n> line 27, in import_string File \"site-packages/django/utils/six.py\", \r\n> line 685, in reraise File \"site-packages/django/utils/module_loading.py\", \r\n> line 23, in import_string ImportError: Module \"django.middleware.common\" does not define a \"CorsMiddleware\" attribute/class\r\n"},"comment":{"url":"https://api.github.com/repos/ottoyiu/django-cors-headers/issues/comments/381098024","html_url":"https://github.com/ottoyiu/django-cors-headers/issues/304#issuecomment-381098024","issue_url":"https://api.github.com/repos/ottoyiu/django-cors-headers/issues/304","id":381098024,"user":{"login":"santhoshdc1590","id":30614728,"avatar_url":"https://avatars2.githubusercontent.com/u/30614728?v=4","gravatar_id":"","url":"https://api.github.com/users/santhoshdc1590","html_url":"https://github.com/santhoshdc1590","followers_url":"https://api.github.com/users/santhoshdc1590/followers","following_url":"https://api.github.com/users/santhoshdc1590/following{/other_user}","gists_url":"https://api.github.com/users/santhoshdc1590/gists{/gist_id}","starred_url":"https://api.github.com/users/santhoshdc1590/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santhoshdc1590/subscriptions","organizations_url":"https://api.github.com/users/santhoshdc1590/orgs","repos_url":"https://api.github.com/users/santhoshdc1590/repos","events_url":"https://api.github.com/users/santhoshdc1590/events{/privacy}","received_events_url":"https://api.github.com/users/santhoshdc1590/received_events","type":"User","site_admin":false},"created_at":"2018-04-13T10:44:33Z","updated_at":"2018-04-13T10:44:33Z","author_association":"NONE","body":"This is my `requirements.txt`\r\n\r\n> django==1.11.1\r\n> djangorestframework==3.8.2\r\n> django-cors-headers==2.2.0\r\n> altgraph==0.15\r\n> cachetools==2.0.1\r\n> certifi==2018.1.18\r\n> chardet==3.0.4\r\n> Django==1.11.1\r\n> future==0.16.0\r\n> google-auth==1.4.1\r\n> idna==2.6\r\n> Jinja2==2.10\r\n> jsonpickle==0.9.6\r\n> macholib==1.9\r\n> MarkupSafe==1.0\r\n> numpy==1.14.2\r\n> opencv-python==3.3.0.9\r\n> pefile==2017.11.5\r\n> pyasn1==0.4.2\r\n> pyasn1-modules==0.2.1\r\n> pycloudfn==0.1.209\r\n> PyInstaller==3.3.1\r\n> pyspin==1.1.1\r\n> python-dateutil==2.6.0\r\n> pytz==2018.3\r\n> requests==2.18.4\r\n> rsa==3.4.2\r\n> scipy==1.0.1\r\n> six==1.10.0\r\n> urllib3==1.22\r\n> Werkzeug==0.12\r\n> google-cloud==0.32.0"}}
{"actor":{"display_login":"santhoshdc1590"}}