Guest User

Untitled

a guest
Oct 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. ## app1/constants.py
  2.  
  3. MY_VAR = 100
  4.  
  5. ## app1/settings.py
  6.  
  7. from django.conf import settings
  8. from app1 import constants
  9.  
  10. MY_VAR = getattr(settings, 'MY_VAR', constants.MY_VAR)
  11.  
  12. ## app1/views.py
  13.  
  14. from django.conf import settings
  15. from app1 import settings as app1_settings
  16.  
  17. print app1_settings.MY_VAR
  18.  
  19. ## project/settings/__init__.py
  20.  
  21. # MY_VAR = 200
Add Comment
Please, Sign In to add comment