django-tenant-admin
Quick Start
In the settings.py:
- Add "tenant_admin.apps.Config" to your INSTALLED_APPS
- Add TENANT_TENANT_MODEL and TENANT_STRATEGY
settings.py
INSTALLED_APPS = [
"demoapp.apps.Config",
...
# 'django.contrib.admin',
...
"django.contrib.staticfiles",
"smart_admin.apps.SmartTemplateConfig",
"smart_admin.apps.SmartConfig",
"admin_extra_buttons",
"tenant_admin.apps.Config",
]
TENANT_TENANT_MODEL = "<app_label>.<model_name>"
TENANT_STRATEGY = "<app_label>.YourStrategy"
urls.py
import tenant_admin.sites
urlpatterns = (
path("manage/", tenant_admin.sites.site.urls),
...
)
Some clarification:
`Strategy` is about visibility
`Permission` is about authorization
Contributing
git checkout https://gitlab.com/os4d/django-tenant-admin.git
cd django-tenant-admin
python -m venv .venv
. .venv/bin/activate
pip install -e .[dev]
pre-commit install
Create sample data
This will create the DB ./django_tenant_admin.sqlite and populate with some example data.
./manage.py demo
This will create:
- 4
Countryrecords: 'Afghanistan', 'Ukraine', 'Somalia', 'Sudan' - 4
Officerecords: 'Afghanistan Office', 'Ukraine Office', 'Somalia Office', 'Sudan Office' - 10
Employeerecords: 'Employee 0' to 'Employee 9' - An 'admin-ukr' user assigned to 'Ukraine Office'
- An 'admin-afg' user and 8 additional users (username3 to username12) assigned to 'Afghanistan Office'
- An 'admin' user not assigned to any office
Try it with:
./manage.py runserver
Connect to http://localhost:8000
NB:
- No need to create users as for demo purposes there is a backend that will create the user on the fly using any password
Metadata
Release files for django-tenant-admin 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-tenant-admin-0.1.0.tar.gz | 29.9 kB | Without provenance | Details for django-tenant-admin-0.1.0.tar.gz |
Release files / django-tenant-admin-0.1.0.tar.gz
| Download URL | django-tenant-admin-0.1.0.tar.gz |
|---|---|
| Size | 29.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cef60b0072b96ba01e069f5cc373958139f403d10e101c678a3cf3aca9a62bc7
|
|
BLAKE2b-256 checksum How to use checksums |
de37e5d3c82d04a50a2fbd8b2e76a1cd84dceccf7aafe5262b2ae519e7fc66b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.2
|
Security for django-tenant-admin 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.