Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

90
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda