Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference Between Satchmo's local_settings.py and settings.py

Can someone explain the difference between local_settings.py and settings.py in Satchmo?

I understand that the settings.py module imports the local_settings.py module as it's final step. So any settings in local_settings.py takes precedence. But what is the point of doing this? Isn't settings.py supposed to be the configuration which is specific to your project anyway? Why bother with the additional step of having local_settings.py?

Basically I find myself needing to add new settings and I can't figure out if I should put them in settings.py or local_settings.py. Can someone shine some light on this?

like image 534
Chris W. Avatar asked Jan 28 '26 03:01

Chris W.


1 Answers

The local_settings.py is only for on your local development system where it extends settings.py. On your deployment server, settings.py is used only without local_settings.py.

One recommendation is that local_settings.py is not included in your repository, so that each developer can have their own and so that it is not used on the deployment server.

Checkout these articles for more information:

  1. Extending Django settings.py File
  2. Extending Settings Variables with local_settings.py in Django
  3. Django settings.py for development and production
  4. A Different Approach to local_settings.py
like image 145
Matthew Rankin Avatar answered Jan 29 '26 20:01

Matthew Rankin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!