Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Deploying django to AWS beanstalk , where to pip install during pipelines?

hiprprogrammer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 7, 2018

Hi ,

Facing a problem while deploying django to beanstalk with python 3.4 .

Beanstalk env and instance all been setup with pipeline yml.

But according to EB cli , can't find a way to install django.

Requirement.txt included in documents but can't be imported.Because there's no django module. So the http server can't been connect.

Here's the error log description , hope this may help 

[ImportError: No module named 'django'

mod_wsgi : Target WSGI script '/opt/python/current/app/ebdjango/ebdjango/wsgi.py' cannot be loaded as Python module.

mod_wsgi : Exception occurred processing WSGI script '/opt/python/current/app/ebdjango/ebdjango/wsgi.py'.

Traceback (most recent call last):
File "/opt/python/current/app/ebdjango/ebdjango/wsgi.py", line 12, in <module>
 from django.core.wsgi import get_wsgi_application

ImportError: No module named 'django'

 

Thanks for your watching and teaching.

1 answer

0 votes
Lava Kumar Dukanam {Appfire}
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 8, 2018

Hi @hiprprogrammer,

There are couple of reasons this can fail.

Make sure your wsgi module python version is correct.

You can manually try to install it using 

pip3 install Django

 and then to confirm its installation try 

pip freeze

Let me know how it goes.

Thanks,

Lava 

hiprprogrammer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 6, 2018

Hi @Lava Kumar Dukanam {Appfire}

Thanks for your assist,

we found out that it takes some steps to deploy on AWS beanstalk

First of all , add

- pip install django==1.11.16

 in the pipeline.yml

 

and also add a requirement.txt undeer your repo root branches with the exact requirement you need so that pipeline will install it.

Django==1.11.16
pytz==2018.7
mysql-connector-python==8.0.6

 

Hope these may help who also meets the same problem.

 

Many thanks to you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events