0 votes
1 view
in AWS by (19.2k points)

I am a beginner in Django. I am doing a project based on it. the project has two stages. I completed the first phase and uploaded the code to the amazon ec2 instance. after completing the 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 there

Traceback (most recent call last):

File "manage.py", line 10, in <module>


File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line


File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute


File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 242, in run_from_argv

self.execute(*args, **options.__dict__)

File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 280, in execute


File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py", line 130, in activate

return _trans.activate(language)

File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 188, in activate

_active.value = translation(language)

File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 177, in translation

default_translation = _fetch(settings.LANGUAGE_CODE)

File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 159, in _fetch

app = import_module(appname)

File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module


ImportError: No module named corsheaders

any suggestions, please

1 Answer

0 votes
by (44.6k points)

Using pip :

pip install django-cors-headers

Using pipenv :

pipenv install django-cors-headers

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !