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


Groups > comp.lang.python > #7221 > unrolled thread

Web Applications - Separating DB Connections

Started byBurhan <burhan.khalid@gmail.com>
First post2011-06-08 00:46 -0700
Last post2011-06-09 00:06 -0700
Articles 4 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  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

#7221 — Web Applications - Separating DB Connections

FromBurhan <burhan.khalid@gmail.com>
Date2011-06-08 00:46 -0700
SubjectWeb Applications - Separating DB Connections
Message-ID<00104e8a-a09c-442c-8b74-f64abf8dcce7@l2g2000prg.googlegroups.com>
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!

[toc] | [next] | [standalone]


#7229

FromStuart MacKay <smackay@flagstonesoftware.com>
Date2011-06-08 11:22 +0100
Message-ID<mailman.24.1307533616.11593.python-list@python.org>
In reply to#7221
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!

[toc] | [prev] | [next] | [standalone]


#7237

FromBurhan <burhan.khalid@gmail.com>
Date2011-06-08 07:19 -0700
Message-ID<9d18a6ad-8aa5-4822-87b8-4c68effd8bd1@p9g2000prh.googlegroups.com>
In reply to#7229
On Jun 8, 1:22 pm, Stuart MacKay <smac...@flagstonesoftware.com>
wrote:
> 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.

Unfortunately our servers are Windows so neat tools like fabric (which
I
had used before on private projects) is out of the question. I am not
aware
of it being using for Windows servers successfully.

Thanks!

[toc] | [prev] | [next] | [standalone]


#7277

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2011-06-09 00:06 -0700
Message-ID<mailman.43.1307603225.11593.python-list@python.org>
In reply to#7237
On Wed, 8 Jun 2011 07:19:14 -0700 (PDT), Burhan
<burhan.khalid@gmail.com> declaimed the following in
gmane.comp.python.general:

> 
> Unfortunately our servers are Windows so neat tools like fabric (which

	Use an ODBC DB-API adapter, specifying an externally defined ODBC
"datasource"? I believe they can be defined including the user/password
needed to access the referred database.

	Not sure if the OS can set them to be used by ODBC but not readable
(via an editor) by users.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web