set DATABASE settings from context
refine get_context_template with postgres configuration