django-db-readonly icon indicating copy to clipboard operation
django-db-readonly copied to clipboard

Provide a way to enable readonly mode through admin interface

Open domenkozar opened this issue 14 years ago • 4 comments

Goal is to avoid restarting server instance

domenkozar avatar Sep 04 '11 22:09 domenkozar

Yeah, I've wanted this too. The thing that is tricky about it is you don't want to write to the database to turn if off. So you need another way to persistently store the setting. Memcache could be an option, but it isn't the best option.

streeter avatar Sep 04 '11 22:09 streeter

Maybe just check if specific file exists?

On Mon, Sep 5, 2011 at 12:28 AM, streeter < [email protected]>wrote:

Yeah, I've wanted this too. The thing that is tricky about it is you don't want to write to the database to turn if off. So you need another way to persistently store the setting. Memcache could be an option, but it isn't the best option.

Reply to this email directly or view it on GitHub:

https://github.com/streeter/django-db-readonly/issues/1#issuecomment-1994271

domenkozar avatar Sep 04 '11 22:09 domenkozar

You can use django-constance for dynamic settings. I realize this might only be a good option for those who already have redis running.

pdr avatar Mar 01 '12 20:03 pdr

https://github.com/streeter/django-db-readonly/pull/22 starts the process, allowing turning it on and off programatically, and there is a note there for how we might be able to have it per-connection instead of all connections.

If we can make it per-connection, the default connection could be turned off, and another connection used only for this app using per-app routing. c.f. https://github.com/just-work/django-database-routing and many other db routers that support that.

jayvdb avatar Sep 17 '20 13:09 jayvdb