nelson687
nelson687

Reputation: 4503

Extend INSTALLED_APPS in settings.py from django reusable app

I'm building a reusable app that has other django dependencies (django-rest-framework for example). I know that if I add it to install_requires in setup.py it will be packaged. But is there a way I can also extend INSTALLED_APPS in settings.py from the project that is using my packaged app so that it adds all the dependencies? At the moment, with this configuration, if I install my packaged app, I need to add my app name to INSTALLED_APPS but also all its dependencies, manually. I would like to think there's a way to avoid having to add all the app's dependencies manually into INSTALLED_APPS ?

Upvotes: 2

Views: 616

Answers (1)

Adharsh M
Adharsh M

Reputation: 3832

Remember that INSTALLED_APPS is just an array

you can simply import that

from othersettings.py import INSTALLED_APPS as IMPORTED_APPS

INSTALLED_APPS = [
    ....
] + IMPORTED_APPS

Upvotes: 1

Related Questions