Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

94
Vistas
Default values in per app django-settings

I've always wondered what is the best way to have per app settings.py files. In a way such as the configuration related to the app can be either on the app settings.py file or in the project settings.py file.

I'm asking this right now because I'm planning to release an app I've developed, and I want it to be reusable. So in the app/settings.py file I'd put the default configuration values.

More precisely, I have an emails app, which is that I want it to be reusable. The structure is as follows:

- emails
  - settings.py
  - tasks.py
  - ...
- my_project
  - settings.py

In the emails/settings.py file I have the default values for the config params:

USE_EMAIL_DIGEST = True
EMAIL_DIGEST_PERIOD = 24*3600

Then, in my_project/settings.py I override some of those params:

EMAIL_DIGEST_PERIOD = 12*3600

What is the best option to access EMAIL_DIGEST_PERIOD param from emails/tasks.py file? Currently I'm doing:

from django.conf import settings
import emails.settings as esettings

getattr(settings, "EMAIL_DIGEST_PERIOD", esettings.EMAIL_DIGEST_PERIOD)

But I think is is very verbose

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda