Skip to content

Instantly share code, notes, and snippets.

@adrienlachaize
Created April 22, 2014 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrienlachaize/11180962 to your computer and use it in GitHub Desktop.
Save adrienlachaize/11180962 to your computer and use it in GitHub Desktop.
Import settings apps of a Django project
"""
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