Skip to main content

django-role-router is a simply, definition designed router with multi-roles.

You can install it with pip. >pip install django-role-router

To use it, make sure you have installed django-role-router already.

  1. Insert middleware jhvar.django.urls.middleware.JvRoleMiddleware after SessionMiddleware.

  2. You can define app role permission like “permitted_roles = [‘admin’]” in urls.py global section.

  3. You can define path role permission like “jv_path(‘admin’, views.my_admin, name=’my_admin’, roles=[‘admin’])” in urlpatterns list. Path role has more priority than app role.

  4. We have supported regex format with “jv_re_path” function, just like “jv_path”. It can also work with rest_framework router.

  5. You can define logger ‘jhvar.django.logger’ in urls.py logger section, to print debug info.

Now, you have role permission verifier, you should add your role granty in somewhere.

It just like “grant_roles(request, ‘admin’)” or “grant_roles(request, (‘admin’, ‘super’))” or “grant_roles(request, [‘admin’, ‘super’])”.

Join it, have fun!

Visit https://github.com/jhvar/django-utils for more detail.

Metadata

Release files for django-role-router 0.2.1

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-role-router 0.2.1
File Size Uploaded
django-role-router-0.2.1.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-role-router 0.2.1
File Interpreter ABI Platform
django_role_router-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / django-role-router-0.2.1.tar.gz

Download URL django-role-router-0.2.1.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
115719b2823627c21b66339627dc283e748bf146c6632f3b31ed1dd3222297fa
BLAKE2b-256 checksum
How to use checksums
f90e6ae3ae3523b574d8e2ab6990776247aa1ecaa9453277b05410699145fbbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.0

Release files / django_role_router-0.2.1-py3-none-any.whl

Download URL django_role_router-0.2.1-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f81a30cf9ea3852da9d41e7b0f0787d14ce63ae7953d6487cb97c25318e8ac01
BLAKE2b-256 checksum
How to use checksums
42261f22bcc4aef3959b371159cd90c088bc040d5c661b7f93c436163cea83e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.0

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.1.10

2 release files

0.1.9

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