Menu

Django with PostgreSQL on a free container tier: the four files that make it production-ready

DEV Community: python·SnapDeploy·9 days ago
#Qa2eb8du
#devtopython#devto#dev#container#django
Reading 0:00
15s threshold

TL;DR: A standard Django project taken to a live URL on a free container tier: Gunicorn, WhiteNoise for static files, settings read from environment variables, and a real PostgreSQL instead of a SQLite file that vanishes on the next deploy. Tested with Django 5.2 LTS on Python 3.12, with a clear line on where free stops and what background work looks like on a container that sleeps.

Django is easy to run locally and surprisingly easy to run badly in production: the dev server left on, static files served by Python, a SQLite file that vanishes on the next deploy. This guide takes a standard Django project to a live URL on a free container tier, with a real PostgreSQL database, and is honest about where "free" stops.

Everything below was tested with Django 5.2 LTS (supported until April 2028) on Python 3.12.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.