mc_djutils / django helpers¶
-
mc_states.modules.mc_djutils.
backup_database
(db_host=None, db_name=None, cfg='project')¶ backup database before some critical operations
-
mc_states.modules.mc_djutils.
restore_from
(db_host=None, db_user=None, db_pass=None, db_name=None, media=None, dump=None, orig_db_host=None, orig_db_name=None, orig_media=None, orig_media_host=None, skip_setup=False, skip_db=False, skip_media=False, dev=None, drop=True, post_hook=None, cfg='project')¶ Restore local django from a distant one Connect to host, get the pg backup connect to another host, load the pg backup sync medias run a post hook if any
- cfg
- name of the makina-states project to get configuration from
-
mc_states.modules.mc_djutils.
setup_database
(db_host=None, db_user=None, db_pass=None, db_name=None, drop=False, cfg='project')¶ Connect to a host with ssh
create a pg user <maybe drop the db> create a db owned by the user