aws depoylment issue while restarting nginx
Question: I am using favfile(<https://ashokfernandez.wordpress.com/2014/03/11/deploying-
a-django-app-to-amazon-aws-with-nginx-gunicorn-git/comment-
page-1/#comment-100>) to deploy a django app. But stuck somewhere.Please help,
a link has been provided for fabfile.

    
    
    Restarting nginx
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] sudo: /etc/init.d/nginx restart
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out: Restarting nginx: nginx.
    
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] sudo: source /home/ubuntu/.virtualenvs/bhuv/bin/activate && python /home/ubuntu/webapps/bhuv/manage.py collectstatic -v 0 --noinput
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out: Traceback (most recent call last):
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:   File "/home/ubuntu/webapps/bhuv/manage.py", line 11, in <module>
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:     execute_from_command_line(sys.argv)
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:   File "/home/ubuntu/.virtualenvs/bhuv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:     utility.execute()
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:   File "/home/ubuntu/.virtualenvs/bhuv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 302, in execute
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:     settings.INSTALLED_APPS
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:   File "/home/ubuntu/.virtualenvs/bhuv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 55, in __getattr__
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:     self._setup(name)
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:   File "/home/ubuntu/.virtualenvs/bhuv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 43, in _setup
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:     self._wrapped = Settings(settings_module)
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:   File "/home/ubuntu/.virtualenvs/bhuv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 99, in __init__
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:     mod = importlib.import_module(self.SETTINGS_MODULE)
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out:     __import__(name)
    [ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com] out: ImportError: No module named prod
    
    
    Fatal error: sudo() received nonzero return code 1 while executing!
    
    Requested: source /home/ubuntu/.virtualenvs/bhuv/bin/activate && python /home/ubuntu/webapps/bhuv/manage.py collectstatic -v 0 --noinput
    Executed: sudo -S -p 'sudo password:'  -u "ubuntu"  /bin/bash -l -c "cd /home/ubuntu/webapps && source /home/ubuntu/.virtualenvs/bhuv/bin/activate && python /home/ubuntu/webapps/bhuv/manage.py collectstatic -v 0 --noinput"
    
    Aborting.
    Disconnecting from ec2-52-62-197-135.ap-southeast-2.compute.amazonaws.com... done.
    


Answer: Did you follow the steps correctly in [Deploying a Django App to Amazon AWS
(with Nginx + Gunicorn +
Git)](https://ashokfernandez.wordpress.com/2014/03/11/deploying-a-django-app-
to-amazon-aws-with-nginx-gunicorn-git/)? The file `settings/prod.py` is
missing. Go read the section `Setting up Our Django Project`. Did you run
`sudo pip requirements.txt`?

    
    
    prod.py for your server Django settings
    

