How to connect to postgres in circle 2.0?

postgresql

#1

Hi there,

I’m just wondering how to do a vanilla connect from Django container to Postgres? Django is currently complaining it can’t find anything running on localhost 5432 which makes sense as its in the separate container. How do i use the postgres image so that I can connect from Django?

Thanks,

version: 2
jobs:
  build:
    working_directory: /app
    docker:
      - image: python:3.4-alpine
      - image: postgres:9.6
      - image: redis:3.2

#2

Actually nevermind. I see it’s here:

DATABASES = {
‘default’: {
‘ENGINE’: ‘django.db.backends.postgresql’,
‘NAME’: ‘postgres’,
‘USER’: ‘postgres’,
‘HOST’: ‘localhost’,
‘PORT’: 5432,
},
}


#3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.