Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7229

Re: Web Applications - Separating DB Connections

Date 2011-06-08 11:22 +0100
From Stuart MacKay <smackay@flagstonesoftware.com>
Subject Re: Web Applications - Separating DB Connections
References <00104e8a-a09c-442c-8b74-f64abf8dcce7@l2g2000prg.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.24.1307533616.11593.python-list@python.org> (permalink)

Show all headers | View raw


A simple way to do this is use fabric for deployment. It allows you to 
upload a file as if it was a template and replaces any placeholder 
strings with values supplied when you upload. The values can be supplied 
either in a config file or interactively when the deployment takes place.

For my django deployments to a production server I have the database 
connection information in a config file that is separate from the app 
source. The name of the config file is passed on the command line when 
running the deployment.

See fabric.contrib.files.upload_template on 
http://docs.fabfile.org/en/1.0.1/api/contrib/files.html
and the --config option on http://docs.fabfile.org/en/1.0.1/usage/fab.html

Stuart MacKay
Lisbon, Portugal

> Hello Everyone:
>
>    I am trying to find a way to extract and remove database connection
> information (username, password, schema name) from the application
> source. I need to do this because in my organization - for security
> reasons - access to databases is controlled by a separate department;
> and as such, when a solution is deployed to production - the
> authentication credentials for the databases are changed (and not told
> to the development team).
>
>    Currently all development is done in Java and with that they have
> the ability to publish databases as a service in their application
> server; this way users can be granted access to modify the credentials
> to the JDBC data source without having to edit source code of the
> application being deployed.  I am looking for something similar in
> Python (short of using Jython).
>
> Thanks!

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Web Applications - Separating DB Connections Burhan <burhan.khalid@gmail.com> - 2011-06-08 00:46 -0700
  Re: Web Applications - Separating DB Connections Stuart MacKay <smackay@flagstonesoftware.com> - 2011-06-08 11:22 +0100
    Re: Web Applications - Separating DB Connections Burhan <burhan.khalid@gmail.com> - 2011-06-08 07:19 -0700
      Re: Web Applications - Separating DB Connections Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-06-09 00:06 -0700

csiph-web