Open/Close database connection in django

Posted by mp0int on Stack Overflow See other posts from Stack Overflow or by mp0int
Published on 2010-06-07T11:36:53Z Indexed on 2010/06/07 11:42 UTC
Read the original article Hit count: 431

I am using Django and Postgresql as my DBMS.

I wish to set a setting that enables to enable/disable database connection. When the connection is set to closed (in settings.py) the site will display a message such as "meintanence mode" or something like that. Django will not show any db connection error message (or mail them to admins). It is appreciated if django do not try to connect to the database at all.

© Stack Overflow or respective owner

Related posts about python

Related posts about database