Web Applications - Separating DB Connections

B

Burhan

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!
 
S

Stuart MacKay

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
 
B

Burhan

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!
 
D

Dennis Lee Bieber

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top