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

186
Views
install multiple apps by one entry in INSTALLED_APPS in django (dependency)

is the concept of dependencies available in Django apps too?

For example, let's say I'm building my own custom Django app "polls" that can be reused in any Django project.

so whenever you need to add it to a project, you will have to add

INSTALLED_APPS = [
    ...
    'polls.apps.PollsConfig',
]

but let's also say, that this polls app depends on the Django REST Framework, so whenever you use it, you will have to add that as well

INSTALLED_APPS = [
    ...
    'polls.apps.PollsConfig',
    'rest_framework',
]

And how about if it depends on even way more apps, do I have to list them all again in the settings.py of each and every project?

Or, is there some way to add rest_framework as an installed app inside the apps.py of the polls app so that it's automatically installed whenever polls is installed on a project?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The pluggable apps cant override the host project's settings. We can add more checks and validations to the apps before the project run.


FYI: to validate the presence of the dependency package, we can make use of the ready(...)--(DOC) method of PollsConfig class as,

from django.contrib.admin.apps import AdminConfig


class PollsConfig(AdminConfig):

    def ready(self):
        try:
            import rest_framework
        except ImportError:
            raise ValueError("Missing 'rest_framework' from 'INSTALLED_APPS'")
over 4 years ago · Santiago Trujillo Report
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!