Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Django Organizations | 1,186 | 34 | 3 | 11 days ago | 55 | November 23, 2023 | 12 | bsd-2-clause | Python | |
:couple: Multi-user accounts for Django projects | ||||||||||
Django Multitenant | 636 | 1 | 2 months ago | 39 | September 26, 2023 | 30 | mit | Python | ||
Python/Django support for distributed multi-tenant databases like Postgres+Citus | ||||||||||
Openwisp Users | 155 | 6 days ago | 9 | bsd-3-clause | Python | |||||
Implementation of user management and multi-tenancy for OpenWISP | ||||||||||
Django Pgschemas | 105 | 7 days ago | 38 | October 16, 2023 | 6 | mit | Python | |||
Django multi-tenancy through Postgres schemas | ||||||||||
Django Tenancy | 75 | 6 years ago | 19 | October 15, 2013 | 1 | Python | ||||
Handle multi-tenancy in Django with no additional global state using schemas. | ||||||||||
Djaodjin Multitier | 10 | 1 | 2 months ago | 29 | October 12, 2023 | 1 | bsd-2-clause | Python | ||
Shared tenancy for Django | ||||||||||
Django Pgrls | 9 | 20 days ago | mit | Python | ||||||
Django multi-tenancy through Postgres row level security | ||||||||||
Django Boardinghouse | 4 | 7 years ago | other | Python | ||||||
Multi tenancy via postgres schemata in django |
Summary | Groups and multi-user account management |
---|---|
Author | Ben Lopatin (http://benlopatin.com) |
Status |
|
Separate individual user identity from accounts, subscriptions, etc.. Django Organizations adds user-managed, multi-user groups to your Django project. Use Django Organizations whether your site needs organizations that function like social groups or multi-user account objects to provide account and subscription functionality beyond the individual user.
Documentation is on Read the Docs
django-organizations should be backend agnostic:
Etc.
The basic functionality should not need much extending. Current dev priorities for me and contributors should include:
Please use the project's issues tracker to report bugs, doc updates, or other requests/suggestions.
The codebase is targeted and tested against:
To run the tests against all target environments, install tox and then execute the command:
tox
Testing each change on all the environments takes some time, you may want to test faster and avoid slowing down development by using pytest against your current environment:
pip install .[tests] pytest
Supply the -x
option for failfast mode:
pytest -x
These submission guidelines will make it more likely your submissions will be reviewed and make it into the project:
Code contributions are expected to pass in all target environments, and pull requests should be made from branches with passing builds on GitHub Actions.
First add the application to your Python path. The easiest way is to use pip:
pip install django-organizations
Check the Release History tab on the PyPI package page for pre-release versions. These can be downloaded by specifying the version.
By default you will need to install django-extensions or comparable libraries if you plan on adding Django Organizations as an installed app to your Django project. See below on configuring.
The simplest way to get started using Django Organizations is to install the app and use the "concrete" models.
Make sure you have django.contrib.auth installed, and add the organizations application to your INSTALLED_APPS list:
INSTALLED_APPS = (
...
'django.contrib.auth',
'organizations',
)
Then update your project URLs config. You should hook in the main application URL conf as well as your chosen invitation backend URLs:
from organizations.backends import invitation_backend
urlpatterns = [
...
url(r'^accounts/', include('organizations.urls')),
url(r'^invitations/', include(invitation_backend().get_urls())),
]
This is the simplest way of using the library, but it's far from the only or even the best way. See the Cooking with Django Organizations section of the docs full explanation of the use cases and how to configure them.
The standard way of using Django Organizations is to use it as an installed app in your Django project. Django Organizations will need to use an auto slug field which are not included. By default it will try to import these from django-extensions, but you can configure your own in settings. The default:
ORGS_SLUGFIELD = 'django_extensions.db.fields.AutoSlugField'
Alternative:
ORGS_SLUGFIELD = 'autoslug.fields.AutoSlugField'
You can specify a different invitation backend in your project settings, and the invitation_backend function will provide the URLs defined by that backend:
INVITATION_BACKEND = 'myapp.backends.MyInvitationBackend'
For most use cases it should be sufficient to include the app views directly using the default URL conf file. You can customize their functionality or access controls by extending the base views.
There are three models:
The underlying organizations API is simple:
>>> from organizations.utils import create_organization
>>> chris = User.objects.get(username="chris")
>>> soundgarden = create_organization(chris, "Soundgarden", org_user_defaults={'is_admin': True})
>>> soundgarden.is_member(chris)
True
>>> soundgarden.is_admin(chris)
True
>>> soundgarden.owner.organization_user
<OrganizationUser: Chris Cornell>
>>> soundgarden.owner.organization_user.user
>>> <User: chris>
>>> audioslave = create_organization(chris, "Audioslave")
>>> tom = User.objects.get(username="tom")
>>> audioslave.add_user(tom, is_admin=True)
<OrganizationUser: Tom Morello>
Django-organizations can act as a base library (not installed in your project) and used to create unique organization model sets using custom tables. See the Cooking with Django Organizations section in the documentation for advice on proceeding.
Anyone is free to use or modify this software under the terms of the BSD license.
Muster is building precision advocacy software to impact policy through grassroots action.