Django Management Commands

While Django Lock Manager is primarily designed to be used programmatically within your Django application via the Python functions and methods - sometimes it can be useful to have administration commands to help when troubleshooting or experimenting with the lock manager.

Once you’ve installed django-lockmgr, including adding the app to your INSTALLED_APPS and ran the migrations, you’ll be able to use the below commands via your Django application’s ./manage.py script.

See the below module links for documentation about each command.

lockmgr.management.commands.clear_lock

The clear_lock management command allows you to delete one or more locks, which may be useful for troubleshooting if you have stagnant locks.

lockmgr.management.commands.list_locks

The list_locks management command allows you to view all current locks, which may be useful for troubleshooting, e.g.

lockmgr.management.commands.reset_locks

The reset_locks management command allows you to delete ALL LOCKS set by django-lockmgr in your application’s database, regardless of their expiration time, name, or who/what created them.

lockmgr.management.commands.set_lock

The set_lock management command allows you to create / renew locks using django-lockmgr from the command line.