Skip to main content

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 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

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

django-groups-sync-0.0.7.tar.gz (8.1 kB view details)

Uploaded Source

File details

Details for the file django-groups-sync-0.0.7.tar.gz.

File metadata

  • Download URL: django-groups-sync-0.0.7.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for django-groups-sync-0.0.7.tar.gz
Algorithm Hash digest
SHA256 3cd83aefbb4abca04bddce444527f9504f6e6f13e7d048ac80cb5fcecd6b4b18
MD5 88ac81a54218c8a3e06fd8c72b12297d
BLAKE2b-256 a0265ddbdb9678ef3e1b2574ae2a11560e6296fbed6d570ff115c6e5e88cf850

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page