SilentDev
SilentDev

Reputation: 22757

how to restart Django server without terminating database and server instance - AWS

I am hosting a Django application on AWS Elastic Beanstalk. I recently made changes to my URLS.py and apparently (according to this thread: Django ignoring changes made to URLS.py file - Amazon AWS ) I need to 'reload the django process / restart the thread'. I figured that meant for me to run

eb stop

and then

eb start

again but when I ran

eb stop

it needed to first terminate my database as well as my EC2 instance, cloudwatch alarm etc. Is there any way for me to restart the DJango process so that it can update the URLS.py file without me having to run

eb stop
eb start

?

Upvotes: 1

Views: 2800

Answers (2)

aaron.cimolini
aaron.cimolini

Reputation: 133

I've had troubles with my Django files not updating after using:

$ eb deploy

The eb cli tool does not have a restart command, however you can login to the AWS console and restart your environment through the actions menu on the dashboard for your eb environment.

This generally fixes any issues that I have. However sometimes I've had to ssh directly into the instance and enable debugging through the settings.

The other command that Rohit referenced is from a different aws cli tool. I haven't personally tried it but here is more documentation on the command and how to install it:

http://docs.aws.amazon.com/cli/latest/userguide/installing.html

Upvotes: 0

Rohit Banga
Rohit Banga

Reputation: 18916

You do not need to stop and start your environment. From what I understand you need to update your environment with your updated source code. Did you try git commit folloed by git aws.push? Take a look here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-reference-get-started.html

Let me know if you run into any issues with git aws.push.

You can also try restart app server on your environment using aws cli: http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/restart-app-server.html But as far as I can tell, git aws.push will suffice.

Upvotes: 1

Related Questions