Created
April 22, 2014 14:17
-
-
Save adrienlachaize/11180962 to your computer and use it in GitHub Desktop.
Import settings apps of a Django project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Paste the code at the end your main settings. | |
It will import all settings files of your django project. | |
It allow to divide settings per app. | |
""" | |
import os.path | |
for d in [d for d in os.listdir(os.path.dirname(__file__)) if os.path.isdir(os.path.join(os.path.dirname(__file__), d))]: | |
app = __import__(d) | |
from app.settings import * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment