Urgent.News

What's breaking now, across thousands of outlets.

Tech

Deploying Django on AWS with Zero Downtime

Originally published on the Djangix blog: Deploying Django on AWS with Zero Downtime Zero downtime on a single small server does not require Kubernetes or a second machine. The practical pattern in the full guide is blue-green on one host: keep two complete copies of your Django app, run only one of them live at a time, and let Nginx decide which one receives traffic. In that setup each colour…

Deploying Django on AWS with Zero Downtime, a comprehensive guide available on the Djangix blog, demonstrates an efficient method to maintain uninterrupted service while updating Django applications. The strategy involves utilizing a blue-green deployment approach on a single server, eliminating the need for Kubernetes or an additional machine. This involves maintaining two complete copies of the Django app, running one at a time, and directing traffic through Nginx.

Each colour of the deployment process has its distinct code directory, virtual environment, Gunicorn service, and local port. However, they all share the same database, media storage, and environment configuration. To deploy, the inactive copy is updated, checked, and migrated, and then started and tested for health before any user sees it. Once the new colour responds correctly, Nginx is pointed to its port, and the proxy is reloaded.

The beauty of this method lies in its rollback capability. If the new release misbehaves, the proxy can be switched back to the previous colour, and the reload initiated within seconds, without the need for a rebuild or frantic restore. This approach not only simplifies the deployment process but also ensures faster rollback times, making it a highly reliable practice.

Key considerations include keeping secrets out of either app directory, preventing collectstatic from overwriting files served by the live copy, and treating database changes that the old code cannot handle as a separate issue, as an instant code rollback cannot undo incompatible migrations.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Blocked by CORS Policy: Every Console Message and Its Real Fix

Originally published on the Djangix blog: Blocked by CORS Policy: Every Console Message and Its Real Fix That red CORS message in the browser console feels like one error, but the sentence that…

  • CORS errors stem from server-side configuration, not client-side code.
  • Blocked by CORS Policy indicates mismatched origin, triggering blocked request.
  • Pre-flight OPTIONS request reveals server's allowance for specific methods and headers.

n8n Not Working? Why Workflows Stop, and the Fix for Each Cause

Most broken n8n workflows aren't broken by n8n. I read 398 public reports from n8n's community forum and Reddit where someone's automation stopped working, and in 317 of them the thread found the…

  • Most workflow failures are not n8n bugs, only ~10% are
  • After n8n 2.0, edits are saved as drafts, not live until Publish
  • Live runs use published version, not the edited one

Cómo elegir silla y monitor para programar sin gastar de más

Pasas entre 6 y 10 horas al día delante de la pantalla. Aun así, la mayoría elegimos silla y monitor por precio o por una oferta.

  • Choose chair with adjustable lumbar support for back comfort during long programming sessions
  • Adjustable armrests crucial to prevent shoulder strain when sitting for six to ten hours daily
  • Monitor resolution (QHD) and IPS panel essential for clear code visibility from various angles

More from Friday 9 October →