local_settings.py - How and why

Create issue
Issue #1335 wontfix
lucy_brennan created an issue

I am not sure how to deal with the local_settings.py. I understand what most of the variables do, but that is not my concern here. Is it necessary? Why is it in a separate file, and not just listed with the other changes that I should do to settings.py in the Installation section of the documentation? Or why is the list of changes in that section not all just in the local_settings.py? Where is the logical division between those two groups of settings? Does local_settings.py override values in settings.py, or the other way around?

Let's say I want to use a different database than the default simple.db. That is specified in the local_settings.py, which is (in most situations) placed somewhere in the site-packages library.

1) Am I supposed to edit that file then, which requires root priveleges, and which will affect all other Satchmo instances created with clonesatchmo? 2) Copy local_settings.py somewhere to my 'store' folder, and change it there? 3) Skip the import, and copy the relevant content to settings.py?

If the answer is 2 or 3, then, why does clonesatchmo.py not do that by itself to begin with?

It is called local_settings.py. So that suggests, that it is more local than the settings.py, right? But it resides somewhere write-protected, which suggests the opposite.

In general, local_settings suggests that settings.py is not local. Which it absolutely is. Whereas local_settings is actually global, if one creates several shops with clonesatchmo and does not remove the import of local_settings.py.

What do the proffessinals do, do they maintain the division into settings.py and local_settings.py? Or how?

Comments (5)

  1. scrapper

    dear lucy,

    i have opened my second beer right now, and your questions and concerns do really make my day (night) better now. Why? Because you have no idea, what you are talking about :-) And why this make me feel happy? Well, because this is exactly how i felt when i started with "real" webdevelopment about one year ago. And let me be clear, i am a programmer and a engineer since years. But I haven´t been so deeply in web-development.

    So you want to know some things about Satchmo,... well i will help you out. First of all. The guys here are great really, they just do not always have the time to answer within 5minutes. You want to learn something more? Well this is not the official discussion Forum about Satchmo. This is the bitbucket issue tracker. :-) I know you think you are talking about issues. But believe me, first sit down, learn some weeks, months, years, and than "maybe" you can enhance Satchmo internals. Don't be angry I am just kidding a bit (had some hard days...) but believe me. Satchmo is highly scalable (thanks to Django) and its awesome. Its really performing well and the guys especially Chris are doing good work for all of us. One day i will give back more than just my little code snippets... hopefully! Still have to learn a lot.

    Right now i just can tell you, the issue tracker is not a forum, nor the Satchmo mailing list. If you have questions, go for the Satchmo mailing list. Even if no one is responding (this happened to me twice) ... you sound like a professional, so please act like one, and use the issue tracker for issues only!

    Right now I can tell you, create a project with Satchmo (and Django) I guess you do not have a lot of experience with django either. [ Believe me I know your way. I am coming from the same direction :-) ] ... create a project a big one and investigate a lot of time. First learn, than understand, and than come back to tell us about enhancements. Don't get me wrong, you can ask a lot of questions in the Satchmo mailing list or in a Forum or in the IRC channel (go for django if on Satchmo no one is responding).

    And finally to your question: local_settings.py exists because in local_settings.py you can alter settings which differ from development to production server. You do not really have to use it that way. You could have similar settings. But as an example I do use memcached on production server and locmem (nothing/dummy) on development server.

    After some weeks (months) of fun and hard work with django and satchmo you will be able to complete the list of why are there settings.py and local_settings.py.

    Well don*t count to much on what i tried to explain. This is my second beer and its really late. But besides my bad english, hopefully you could get the point.

    Overriding: local_settings.py is processed after settings.py so the last value counts. all right? (yes its overwriting settings.py)

    Have fun with django and Satchmo sc

  2. lucy_brennan reporter
    • changed status to new

    Thanks for your positive and cheerful words. However, I believe you misunderstood my intent. In this thread, http://groups.google.com/group/satchmo-users/browse_thread/thread/2bf7dea77f684ddd, I criticized the Satchmo documentation, and was then encouraged to submit issues with the problems.

    This is one such 'issue', that I have submitted. I (now) know the answers to most of the questions, but when reading it first, I had all of the above unanswered questions.

  3. lucy_brennan reporter

    I realize now, that there is a problem with some of my questions. When using clonesatchmo.py, actually the local_settings.py _is_ copied to the 'store' folder. For some reason, I thought it was not. Ooops.

  4. scrapper

    Dear Lucy,

    I know its hard to start off. With time everything will get more clear. Right now I am searching for 5days, why my province/state section is not getting updated via AJAX. I guess its just a matter of one codeline. And I am searching for 5days now :-)

    I wish you the best and fast solutions!



  5. Hynek Cernoch

    Files settings.py and local_settings.py should be writable under developers unpriviged account. They are usually copied a customized from templates by clonesatchmo.py then are sustomized by the user. What variable should be placed to which file is neither perfect nor unambiguous, but I understand that it originated somehow historically and rationally. While new users prefer clarity, long-term users prefer consistency with only well-grounded changes and changes with a value-added.

    I agree but I set wontfix for now, if you do not progress.

    (In our country we say: Change is life. also: Life is beautiful. I want to add now: Though also software is nice and hard, Life is not software :-)

  6. Log in to comment