A complete guide to organizing settings in Django

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • django-environ

    Django-environ allows you to utilize 12factor inspired environment variables to configure your Django application.

  • Docker does not do any quote parsing. For this same env file, it will set the value of the variable to `"foo"` (retaining the doublequotes in the value).

    Bash, of course, requires quotes if the variable contains any special bash characters (for example, literal JSON with curly brackets), but its quote handling is much more complex. django-environ doesn't interpret bash code; it just does simple quote chomping.

    There's no reliable .env syntax you can use that works in all 3 of django-environ, Docker, and bash; and any variable that should start and end with quotes that are not stripped off can't be expressed in a way that both Docker and django-environ will read in the same way.

    This may seem like a nit-picking edge case, but it's indicative of the design philosophy in django-environ of trying to be "helpful", but in ways which lead to subtle confusion. The way it guesses the path to your `.env` file is another example.

    [1] https://github.com/joke2k/django-environ/blob/main/environ/e...

  • python-decouple

    Strict separation of config from code.

  • I use python-decouple with django and it’s solved this pretty elegantly. A dotenv file for local and env variables for production. Isn’t that the 12 factor recommendation?

    https://github.com/henriquebastos/python-decouple

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • django-classy-settings

    Minimalist approach to class-based settings for Django

  • While we started off using `django-environ` to help manage environment-based/12-factor settings, we've moved away from it in favor of django-classy-settings.

    The biggest knock against django-environ is that it does not treat the `.env` syntax the same as Docker or bash -- meaning that the same environment file can't be reliably used to provide variables for both the container and Django.

    django-classy-settings has been a joy to use, and its code is really simple and readable (~150 lines).

    [0] https://github.com/funkybob/django-classy-settings/

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • For a beginner, when do you look at the “next steps” like deploying?

    2 projects | /r/djangolearning | 25 May 2023
  • How to send emails using python django ?

    1 project | dev.to | 10 Oct 2022
  • Searching Tweets Using Twitter API

    2 projects | dev.to | 3 Sep 2021
  • Buscando Tweets com a API do Twitter

    2 projects | dev.to | 3 Sep 2021
  • Tricks for starting a new project

    3 projects | /r/django | 30 Nov 2022