Skip to content

CodePalTutorials/django-elasticbeanstalk-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django AWS Elastic Beanstalk Starter template

Get a new django app up and running in in Elastic beanstalk in under 5 minutes

A starter template to get you up and running django app that works out of box with AWS Elastic Beanstalk.

The template contains following settings:

  • Default settings for Project root, static root.
  • Separate Development, Testing and Production settings for seamless deployment
  • Celery fully configured to run in Elastic beanstalk app
  • Automatic Db migrations when deploying.

How to start?

Prerequisites

On your local machine, you should have folloing configured:

  • Postgres DB
  • Rabbit MQ Broker
  • AWS CLI installed and configured.

To complete prerequisites, refer this tutorial.

Steps

  1. In your project folder, clone contents of this repo with:
 $ git clone git@github.com:CodePalTutorials/django-elasticbeanstalk-starter.git .
  1. Init python virtual environement and install requirements.
$ virtualenv venv
$ pip install -r < requirements.txt
  1. Add local database settings in ebdjango/local_settings.py.

  2. Create elastic beanstalk app and provision a postgres database with that app.

$ eb init -p python2.7 <appname>
$ eb init
$ eb create production-env

For more details on how, rerfer Step 6 of this tutorial.

  1. Set correct environment variables in Elastic beanstalk environment. For ex, to make current environment production environment, set:
$ eb setenv ENVIRONMENT=PROD

Options are PROD, TEST and DEVEL..

  1. Set your rabbit MQ broker URL in ebdjango/testing_settings.py & ebdjango/production_settings.py.

  2. Deploy with eb deploy.

Detailed Tutorial

Refer to the tutorial below if you need more help with setting things up: https://codepal.herokuapp.com/deploying-django-app-on-aws-using-elastic-beanstalk/) tutorial.

  1. Creating & Deploying basic Django app on Elasticbeasntalk: https://codepal.herokuapp.com/deploying-django-app-on-aws-using-elastic-beanstalk.
  2. Adding celery on Django Elastic beanstalk app: [WIP]

Contribution

Any suggestions and contribution and welcome. Feel free to send PR and raise issues.

About

The Ultimate Django starter template for Elastic Beasntalk

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •