Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.06; '(b)': 0.07; 'separately': 0.09; 'subject:module': 0.09; 'subject:skip:c 10': 0.09; 'cc:addr:python-list': 0.11; 'question.': 0.14; '(server,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hardware.': 0.16; 'port,': 0.16; 'subject:etc.': 0.16; 'subject:values': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'file,': 0.19; 'cc:addr:python.org': 0.22; '(a)': 0.24; 'config': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'script': 0.25; 'header:In-Reply-To:1': 0.27; '(c)': 0.29; 'am,': 0.29; 'database,': 0.30; 'message-id:@mail.gmail.com': 0.30; 'usually': 0.31; 'credentials': 0.31; 'subject:what': 0.31; 'file': 0.32; 'run': 0.32; 'becomes': 0.33; 'guess': 0.33; 'trouble': 0.34; 'sense': 0.34; 'maybe': 0.34; 'could': 0.34; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'changing': 0.37; 'files': 0.38; 'issue': 0.38; 'rather': 0.38; 'how': 0.40; 'even': 0.60; 'more': 0.64; 'situation': 0.65; 'subject:. ': 0.67; 'production': 0.68; 'different.': 0.84; 'end.': 0.84; 'situations,': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=H0KKN+ObB/bhHXcdRsIxEhubfK0heTczPuGxYVFLhJM=; b=haSQDVMTdoUUQ0SNf2aRYx4gQRMD+cCgjtklZwunIeaB7bLJ2KFUdJoUysY0FIRiw+ 3T6zEI9bCVCk0amA/lMHmpg+V71D9lMi98d3dYri3hMiWRXwZuQwIrwncmlNGMdMZqKX kDIVkyepOgWLQ9uj2t/qzeQoY+IvTRJrXDkB+JE9pxIetuiiQ2FmwX18xy8yURwl60o4 59v0+8myN/dvijjju5pss9UUa6ca7VyUjhe/bgHJd26EeaXDCYBOxnxLNQu1a9tGRzzp RI1Jd88FuhEbObw/t9dRi5S4Ejxf5xo24Beqr299jT2jS90lIV2KutNTI/WF3yrSHR3L Terw== MIME-Version: 1.0 X-Received: by 10.112.78.98 with SMTP id a2mr44596726lbx.48.1412099348516; Tue, 30 Sep 2014 10:49:08 -0700 (PDT) In-Reply-To: <3u5rfb-mct.ln1@chris.zbmc.eu> References: <54hqfb-nan.ln1@chris.zbmc.eu> <36d7ddca-29f4-403c-a64d-611e187afc3a@googlegroups.com> <2ea96bcf-e905-4d77-a105-82b27715aa6e@googlegroups.com> <3u5rfb-mct.ln1@chris.zbmc.eu> Date: Wed, 1 Oct 2014 03:49:08 +1000 Subject: Re: Keepin constants, configuration values, etc. in Python - dedicated module or what? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412099356 news.xs4all.nl 2881 [2001:888:2000:d::a6]:59085 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:78501 On Wed, Oct 1, 2014 at 3:30 AM, wrote: > The main trouble with this approach is that I need some way to have > the python/config file available at the 'home' end of this as well as > at the 'remote' end. I guess I could write a copy of the file into > the database but then I have the editing issue again, changing it > becomes messy. If it's not in the database then how do I 'tie' it to > the data? That's a design question. Maybe it's better for you to do your config in the database. I usually find that these config files include database credentials (server, port, user name, password), so they have to be (a) outside the database, (b) outside source control, and (c) separately configurable for test and production systems, even if they run on the exact same hardware. So for those situations, it makes more sense to have them in a script or INI file, rather than the database. Your situation may well be completely different. ChrisA