Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!