Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to run a django project on aws?

How should the project be deployed and run. There are loads of tools in this space. Which should be used and why?

  • Supervisor
  • Gunocorn
  • Ngnix
  • Fabric
  • Boto
  • Pip
  • Virtualenv
  • Load balancers
like image 862
Matt Alcock Avatar asked Feb 24 '12 00:02

Matt Alcock


1 Answers

It depends on your configuration. We are using the following stack for our environment on Rackspace, but you can setup the same thing on AWS with EC2 instances.

  • Ubuntu 11.04
  • Varnish (in memory cache) to avoid disk seeks
  • NginX to server static content
  • Apache to server dynamic content (MOD-WSGI)
  • Python 2.7.2 with Django
  • Jenkins for our continuous builds
  • GIT for version control
  • Fabric for the deployment.

So the way it works is that a GIT push to the origin repository is being polled by Jenkins. Jenkins then pulls the changes down from the origin. Builds a Python Egg, runs Unit tests, uses Fabric to deploy this egg to the environments necessary and reloads the Apache config to make sure the forked Apache processes are picking up the new Python egg.

Hope this helps.

like image 160
Michael Avatar answered Sep 28 '22 14:09

Michael