Python – import error django corsheaders

amazon ec2djangodjango-cors-headerspython

i am a beginner in django. i am doing project based on it. project has two stages. i completed first phase and uploaded the code to amazon ec2 instance. after completing second phase i added some packages like python-social-auth, django-cors-headers, django-easy-maps, crispyforms. but now it is showing import error for corsheaders and this the traceback
i have checked virtual environment and corsheaders package is ther

Traceback (most recent call last):
File "", line 10, in <module>
File "/usr/local/lib/python2.7/dist-packages/django/core/management/", line 399, in execute_from_command_line
File "/usr/local/lib/python2.7/dist-packages/django/core/management/", line 392, in execute
File "/usr/local/lib/python2.7/dist-packages/django/core/management/", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/", line 280, in execute
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/", line 130, in activate
return _trans.activate(language)
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/", line 188, in activate
_active.value = translation(language)
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/", line 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/", line 159, in _fetch
app = import_module(appname)
File "/usr/local/lib/python2.7/dist-packages/django/utils/", line 40, in import_module
ImportError: No module named corsheaders

any suggestions please

Best Answer

Using pip :

pip install django-cors-headers

Using pipenv :

pipenv install django-cors-headers