A set of management commands to export and sync Django User Groups permissions between environments.
Project description
Django Groups Sync
Overview
A set of management commands to export and sync Django User Groups permissions between environments.
Getting It
$ pip install django-groups-sync
If you want to install it from source, grab the git repository from GitHub and run setup.py:
$ git clone git://github.com/hansek/django-groups-sync.git
$ cd django-groups-sync
$ python setup.py install
Installing It
To enable groups_sync
in your project you need to add it to INSTALLED_APPS
in your projects
settings.py
file:
INSTALLED_APPS = (
...
'groups_sync',
...
)
Settings
-
GROUP_SYNC_FILENAME
Filename (and location) of JSON file for export/sync, default value
groups_permissions.json
.
Usage
There are two management commands.
If you dont want anything to be displayed on stdout use verbosity argument -v0
Export groups permissions
It will save all groups permissions from database to json file.
$ python manage.py export_groups_permissions
Arguments
-
one or multiple group names you only want to include in the export data
$ python manage.py export_groups_permissions "Group 1" "Group 2"
-
--file
- specifies file to which the output is written (default value byGROUP_SYNC_FILENAME
)
Synchronize groups permissions
It will update database groups permissions by content of json file.
$ python manage.py sync_groups_permissions
Arguments
-
A Group name(s) which should only be synchronized (use "" if there are spaces in Group name).
$ python manage.py export_groups_permissions "Group 1" "Group 2"
-
--file
- specifies json data file (default value byGROUP_SYNC_FILENAME
) -
--noinput
or--no-input
- do NOT prompt the user for input of any kind
Credits
Inspired by Dan's Cheat Sheets > Permissions.
Cheers
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_groups_sync-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35865d8c4f7c7f2fab1e8cc7d6e16ad04dcd573e3a8a5412173c71d037ea1ed5 |
|
MD5 | 95de8028b127454882e98ea73a417bcc |
|
BLAKE2b-256 | f85a05f4ef95c9bc10ad3902069c0ad6ee3a6af113ba8315313b7c8dca76d956 |