How to deploy Django application on Amazon AWS?

Hello,

I'm trying to deploy a simple application to Amazon AWS; before I deploy my real application, I'm following this tutorial: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python_django.html 

But I'm getting this error when I type in the "eb deploy" command: ERROR: Your WSGIPath refers to a file that does not exist.

Here is my WSGI file:
"""
WSGI config for mysite project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""

import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

Open in new window


Appreciate any help in resolving this error!
Errang GenevreAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gheistCommented:
Where is the error?
0
btanExec ConsultantCommented:
The error is stated as "ERROR: Your WSGIPath refers to a file that does not exist."

Likely this is due to storing all of the code in one directory instead the correct mean is to have it in its respective code in its corresponding folder (not in single parent site folder ).
your root directory would look like this:
.
├── .ebextensions
│   └── python.config
├── .elasticbeanstalk
│   ├── config
├── .git
├── .gitignore
├── manage.py
├── mysite
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
└── requirements.txt
Instead of this:
.
└── mysite
    ├── .ebextensions
    ├── .elasticbeanstalk
    ├── .git
    ├── .gitignore
    ├── manage.py
    ├── mysite
    └── requirements.txt
https://forums.aws.amazon.com/thread.jspa?messageID=396656#396656

Note also make sure your requirements.txt file contains the Django and MySQL version numbers that you want to use.
Django==1.4.1
MySQL-python==1.2.3
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python_django.html
0
Errang GenevreAuthor Commented:
@gheist

This is the error I'm getting: ERROR: Your WSGIPath refers to a file that does not exist.

@btan

Yes, I saw the Django 1.4.1 version; but my project was built using Django 1.7.1, and it is not compatible with Django 1.4.1

I can't find any real documentation on deploying Django 1.7.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Errang GenevreAuthor Commented:
At the end of the day, I would greatly appreciate a tutorial on how to deploy Django 1.7 onto Amazon Elastic Beanstalk.

I still haven't been able to find *any* documentation on that.
0
gheistCommented:
You posted a tutorial in your question? It is in English, so you can read it?

At which step you get the error? Is demo site working without apache?
0
btanExec ConsultantCommented:
not a document per se but may be useful, do review it. the requirement.txt in the github is
Django==1.7.1
Pillow==2.6.1
psycopg2==2.5.4
wsgiref==0.1.2
https://realpython.com/blog/python/deploying-a-django-app-to-aws-elastic-beanstalk/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Errang GenevreAuthor Commented:
@gheist

The Amazon tutorial I posted only works for 1.4.1. And yes, I can read it, and I tried about 5 variations of the tutorial.

And I'm getting an error at the step with the alias; so I know that tutorial is outdated.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
AWS

From novice to tech pro — start learning today.