django - Using Constants in Settings.py -
Do I declare a variable in the settings.py
of the Django project in one of my module files? I can use
For example, using DATABASE_HOST = 'databasename'
?
I am trying to get the name of the server on which the application is currently posted on you.
You can of course ... it can be encouraged, to actually use it , Import settings from django.conf (this imports the settings of your project):
This document explains why this works, and why the settings.py
module is better than importing directly.
Comments
Post a Comment