Skip to main content

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 by GROUP_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 by GROUP_SYNC_FILENAME)

  • --noinput or --no-input - do NOT prompt the user for input of any kind

  • --dry-run or -n - do everything except modify the database

Credits

Inspired by Dan's Cheat Sheets > Permissions.

Cheers

Metadata

Release files for django-groups-sync 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-groups-sync 0.0.7
File Size Uploaded
django-groups-sync-0.0.7.tar.gz 8.1 kB Details

Release files / django-groups-sync-0.0.7.tar.gz

Download URL django-groups-sync-0.0.7.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3cd83aefbb4abca04bddce444527f9504f6e6f13e7d048ac80cb5fcecd6b4b18
BLAKE2b-256 checksum
How to use checksums
a0265ddbdb9678ef3e1b2574ae2a11560e6296fbed6d570ff115c6e5e88cf850
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.0.7 This release

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page