django - ImportError: No module named corsheaders -
installed_apps = [ 'login.apps.loginconfig', 'mainsaaas.apps.mainsaaasconfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'corsheaders', ] middleware = [ 'django.middleware.security.securitymiddleware', 'django.contrib.sessions.middleware.sessionmiddleware', 'corsheaders.middleware.corsmiddleware', 'django.middleware.common.commonmiddleware', 'django.middleware.csrf.csrfviewmiddleware', 'django.contrib.auth.middleware.authenticationmiddleware', 'django.contrib.messages.middleware.messagemiddleware', 'django.middleware.clickjacking.xframeoptionsmiddleware', ] cors_origin_allow_all = true
even installed
pip install django-cors-headers. shows import error corsheaders , traceback have checked virtual environment , corsheaders package there
> trace back: > > > unhandled exception in thread started <function wrapper @ 0x7f5a7d5a1aa0> traceback (most recent call last): file > "/home/next/virtual_env/venv/local/lib/python2.7/site-packages/django/utils/autoreload.py", > line 226, in wrapper > fn(*args, **kwargs) file "/home/next/virtual_env/venv/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", > line 113, in inner_run > autoreload.raise_last_exception() file "/home/next/virtual_env/venv/local/lib/python2.7/site-packages/django/utils/autoreload.py", > line 249, in raise_last_exception > six.reraise(*_exception) file "/home/next/virtual_env/venv/local/lib/python2.7/site-packages/django/utils/autoreload.py", > line 226, in wrapper > fn(*args, **kwargs) file "/home/next/virtual_env/venv/local/lib/python2.7/site-packages/django/__init__.py", > line 27, in setup > apps.populate(settings.installed_apps) file "/home/next/virtual_env/venv/local/lib/python2.7/site-packages/django/apps/registry.py", > line 85, in populate > app_config = appconfig.create(entry) file "/home/next/virtual_env/venv/local/lib/python2.7/site-packages/django/apps/config.py", > line 90, in create > module = import_module(entry) file "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module > __import__(name) importerror: no module named corsheaders
am using virtual environment , django version is: django==1.10.5
Comments
Post a Comment