Infrastructure

Docker Image for Django Application (Alpine Based)

August 21, 2022
Infrastructure
docker

Apline based images have a huge advantage by it’s final size but in most cases in the Python world if neotiates by Python dependencies which takes too long to build project packages and final size sometimes may be greater than same image build on debian based image. But Apline still great solution for small Django applications to keep final image tiny.
This post written after the similar post related to the debian based image build proccess, so I wont specify here all environmental details and just provide few Dockerfile examples which you may to use for start.

...

Docker Image for Django Application (Debian Based)

August 20, 2022
Infrastructure
docker

Docker is most reliable and flexible way to distribute your Django applications, it able to include entire environment settings, dependencies and application files to deploy it to the server or any cloud provider. This post show you a few examples how to build Docker image for your Django application, this will be based on Debian base images as it recommended option for Python applications, of course it could be build based on Alpine images but it mostly suitable for small apps because in most cases build time and final image size based on Alpine would be bigger than Debian based, more about issues with Alpine based images you can read here and here. ...

Use Environment Variables in Django - Efficient Way

August 16, 2022
Infrastructure
env

If you stil not use environment variables to configure your Django application - dont wait, do it! I’ll tell you efficient way to use environment variables in the Django’s settings.py file which allows you to set environment variables via the server environment and in the .env file for local development. Installation # You need to install python-decouple package from PyPi. pip pip install python-decouple poetry poetry add python-decouple pipenv pipenv install python-decouple Usage in settings. ...