Django and aws elastic beanstalk

94 views
Skip to first unread message

mat...@vogcalgaryappdeveloper.com

unread,
Jul 14, 2016, 7:32:47 AM7/14/16
to django...@googlegroups.com

Hi, I’ve been directed to you for technical support regarding Django. I can get it working on my own computer running on the provided local server however when I follow any tutorial to host it on elastic beanstalk I get one of two of the following errors:

        “ERROR: your requirements.txt is invalid.”

        “ERROR: WSGIPath refers to a file that does not exist.”

 

I’ve tried everything I can think of but nothing seems to work.

I look forward to hearing back from you and hope that you can help me with this.

 

 

Matthew Bates
VOG Calgary Developer Inc - We Are Mobile Development Professionals
Phone: (403) 399-2519 || Email: mat...@vogcalgaryappdeveloper.com
1900 11 Street SE,Suite 150, Calgary, AB T2G 3G2

 

mat...@vogcalgaryappdeveloper.com

unread,
Jul 16, 2016, 6:09:14 PM7/16/16
to django...@googlegroups.com

Yik San Chan

unread,
Jun 5, 2018, 10:21:00 PM6/5/18
to Django users
For requirements.txt, you have to run
pip freeze > requirements.txt

For the second error, you have to run
eb config
Then change WSGIPath to point to your wsgi.py file.

David Bednarczyk

unread,
Jun 6, 2018, 1:45:48 PM6/6/18
to django...@googlegroups.com
Im sure you already checked but make sure you also have the appropriate container commands in the .ebextensions folder, under a django.config or python.config file, what ever  you want to call it should work.  It should look similar to this:

container_commands:
01_migrate:
command: "python manage.py migrate"
leader_only: true
02_collectstatic:
command: "python manage.py collectstatic --noinput"
03_createsu:
command: "python manage.py createsuperuser"
leader_only: true

option_settings:
"aws:elasticbeanstalk:application:environment":
DJANGO_SETTINGS_MODULE: "YOURPROJECT.settings"
PYTHONPATH: "$PYTHONPATH"
"aws:elasticbeanstalk:container:python":
WSGIPath: "YOURPROJECT/wsgi.py"
StaticFiles: "/static/=www/static/"

packages:
yum:
postgresql95-devel: []
If you havent already read this one, this article recently helped me set up an environment:

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0cd3efa2-b2ec-4234-b29e-a7dbe31486ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

David J. Bednarczyk
Top Dog, Mister Benj
www.misterbenj.com



 
Reply all
Reply to author
Forward
0 new messages