[{"data":1,"prerenderedAt":246},["ShallowReactive",2],{"\u002Fposts\u002Fcookiecutter-django-with-amazon-rds":3,"\u002Fposts\u002Fcookiecutter-django-with-amazon-rds-surround":239},{"id":4,"title":5,"body":6,"categories":220,"date":222,"description":223,"extension":224,"meta":225,"navigation":120,"path":226,"seo":227,"stem":228,"tags":229,"__hash__":238},"posts\u002Fposts\u002Fcookiecutter-django-with-amazon-rds.md","Cookiecutter Django With Amazon RDS",{"type":7,"value":8,"toc":215},"minimark",[9,13,17,22,33,37,44,85,89,96,103,205,208,211],[10,11,5],"h1",{"id":12},"cookiecutter-django-with-amazon-rds",[14,15,16],"p",{},"So, we need to connect our docker based django app to our RDS instance, here are the steps to do so.",[18,19,21],"h2",{"id":20},"step-1","Step 1",[14,23,24,25,29,30],{},"Remove ",[26,27,28],"code",{},"DATABASE_URL=postgres:\u002F\u002Fpostgres"," from ",[26,31,32],{},".envs\u002F.production\u002F.django",[18,34,36],{"id":35},"step-2","Step 2",[14,38,39,40,43],{},"Update ",[26,41,42],{},".envs\u002F.production\u002F.postgres"," and setup your database credentials.",[45,46,51],"pre",{"className":47,"code":48,"language":49,"meta":50,"style":50},"language-env shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","POSTGRES_HOST=              # db host\nPOSTGRES_PORT=              # db port\nPOSTGRES_DB=                # db name\nPOSTGRES_USER=              # db user\nPOSTGRES_PASSWORD=          # db pass\n","env","",[26,52,53,61,67,73,79],{"__ignoreMap":50},[54,55,58],"span",{"class":56,"line":57},"line",1,[54,59,60],{},"POSTGRES_HOST=              # db host\n",[54,62,64],{"class":56,"line":63},2,[54,65,66],{},"POSTGRES_PORT=              # db port\n",[54,68,70],{"class":56,"line":69},3,[54,71,72],{},"POSTGRES_DB=                # db name\n",[54,74,76],{"class":56,"line":75},4,[54,77,78],{},"POSTGRES_USER=              # db user\n",[54,80,82],{"class":56,"line":81},5,[54,83,84],{},"POSTGRES_PASSWORD=          # db pass\n",[18,86,88],{"id":87},"step-3","Step 3",[14,90,91,92,95],{},"Comment or remove Postgres volumes and services from ",[26,93,94],{},"production.yml"," file.",[14,97,98,99,102],{},"You will have to remove the complete ",[26,100,101],{},"postgres"," service.",[45,104,108],{"className":105,"code":106,"language":107,"meta":50,"style":50},"language-yml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Filename: \u002Fproduction.yml`\n\nvolumes:\n    # production_postgres_data: {} ## Remove or comment this\n    # production_postgres_data_backups: {} ## Remove or comment this\n...\nservices:\n  django: &django\n    depends_on:\n      # - postgres ## Remove or comment this\n\n# postgres: ## Remove or comment this whole block\n    ...\n","yml",[26,109,110,116,122,132,137,142,149,157,173,181,187,192,198],{"__ignoreMap":50},[54,111,112],{"class":56,"line":57},[54,113,115],{"class":114},"sHwdD","# Filename: \u002Fproduction.yml`\n",[54,117,118],{"class":56,"line":63},[54,119,121],{"emptyLinePlaceholder":120},true,"\n",[54,123,124,128],{"class":56,"line":69},[54,125,127],{"class":126},"swJcz","volumes",[54,129,131],{"class":130},"sMK4o",":\n",[54,133,134],{"class":56,"line":75},[54,135,136],{"class":114},"    # production_postgres_data: {} ## Remove or comment this\n",[54,138,139],{"class":56,"line":81},[54,140,141],{"class":114},"    # production_postgres_data_backups: {} ## Remove or comment this\n",[54,143,145],{"class":56,"line":144},6,[54,146,148],{"class":147},"sBMFI","...\n",[54,150,152,155],{"class":56,"line":151},7,[54,153,154],{"class":126},"services",[54,156,131],{"class":130},[54,158,160,163,166,170],{"class":56,"line":159},8,[54,161,162],{"class":126},"  django",[54,164,165],{"class":130},":",[54,167,169],{"class":168},"s7zQu"," &",[54,171,172],{"class":147},"django\n",[54,174,176,179],{"class":56,"line":175},9,[54,177,178],{"class":126},"    depends_on",[54,180,131],{"class":130},[54,182,184],{"class":56,"line":183},10,[54,185,186],{"class":114},"      # - postgres ## Remove or comment this\n",[54,188,190],{"class":56,"line":189},11,[54,191,121],{"emptyLinePlaceholder":120},[54,193,195],{"class":56,"line":194},12,[54,196,197],{"class":114},"# postgres: ## Remove or comment this whole block\n",[54,199,201],{"class":56,"line":200},13,[54,202,204],{"class":203},"sbssI","    ...\n",[14,206,207],{},"Your Django app should now connect to your RDS database in production.",[14,209,210],{},"Feel free to leave any feedback or queries.",[212,213,214],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":50,"searchDepth":63,"depth":63,"links":216},[217,218,219],{"id":20,"depth":63,"text":21},{"id":35,"depth":63,"text":36},{"id":87,"depth":63,"text":88},[221],"Development","2021-04-02T00:00:00.000Z","This article will assist you in setting up your docker based Django cookiecutter app with a Postgres database on Amazon RDS, also works with other hosted databases.","md",{},"\u002Fposts\u002Fcookiecutter-django-with-amazon-rds",{"title":5,"description":223},"posts\u002Fcookiecutter-django-with-amazon-rds",[230,231,232,233,234,235,236,237],"Amazon","AWS","RDS","django","cookiecutter","python","Postgres","docker","hbrZZx_hIjntkKCa0KVFlBhrfmZgfKoFge5tmAmqyNw",[240,241],null,{"title":242,"path":243,"stem":244,"description":245,"children":-1},"Sending Notifications to Django Users","\u002Fposts\u002Fsending-notifications-to-django-users","posts\u002Fsending-notifications-to-django-users","The article helps implementing notification sending to django >=3.2 user(s).",1775372017105]