Skip to content

Instantly share code, notes, and snippets.

@ba11b0y
Last active May 23, 2018 21:48
Show Gist options
  • Save ba11b0y/2a5e1613fd92699d4720496bcab4eaa6 to your computer and use it in GitHub Desktop.
Save ba11b0y/2a5e1613fd92699d4720496bcab4eaa6 to your computer and use it in GitHub Desktop.
Deployment Commands

Creating a New Amazon EC2 instance

  • Refer Snapshots

Activating/Creating Virtual Environment

  • virtualenv venvforfinlit -p python3
  • source venforfinlit/bin/activate

Installing dependencies

  • sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx
  • pip install -r requirements.txt

Setting up RDS PostgreSQL instance

  • Refer snapshots

Adding Security Group in RDS instance to enable connection from EC2

  • Refer snapshots

Grant permissions to user finlit

  • ALTER ROLE finlit SET client_encoding TO 'utf8';
  • alter role finlit set timezone to 'Asia/Calcutta';
  • GRANT ALL PRIVILEGES ON DATABASE finlit_db TO finlit;

Configure Django settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'finlit_db',
        'USER': 'finlit',
        'PASSWORD': 'finlit123',
        'HOST': 'finlit-db.cba220xdqqwl.us-east-1.rds.amazonaws.com',
        'PORT': '5432',
    }
}

Configure redis, celery, celery-beat and memcached

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment