How do I do that? split up 2 files?
Advertisement
Answer
Although my solution is not as complex as the ones above, they fit my simple needs: I have some imports in my settings.py file:
JavaScript
x
10
10
1
try:
2
from settings_local import *
3
except ImportError:
4
pass
5
6
try:
7
from settings_production import *
8
except ImportError:
9
pass
10
And then I have a settings_local.py file in my local development folder (which I don’t upload to the server) and where I overwrite local settings. Then I have a settings_production.py server where I keep settings needed for the production environment.
You can use this technique to import other settings files as well.