Skip to main content

a util set for django

Project description

#usage ##install

pip install xdj-utils

##setting ###additional

USERNAME_FIELD = 'username'
ROLE_MODEL = 'xdj_system.Role'
DEFAULT_ROLE = ['']
ANONYMOUS_ROLE = ['']

###modification

USERNAME_FIELD = 'username'
ROLE_MODEL = 'xdj_system.Role'
DEFAULT_ROLE = ['']
ANONYMOUS_ROLE = ['']

#settings for modifying
MIDDLEWARE = [
    ...
    xdj_utils.middleware.ApiLoggingMiddleware
]

REST_FRAMEWORK = {
    ...
    'DEFAULT_FILTER_BACKENDS':(
        'xdj_utils.filters.CustomDjangoFilterBackend',
        ...
    ),
    'DEFAULT_PAGINATION_CLASS': 'xdj_utils.pagination.CustomPagination',
    'DEFAULT_AUTHENTICATION_CLASSES':(
        ...
        'xdj_utils.authentications.AnonymousAuthenticated',
    ),
    'EXCEPTION_HANDLER': 'xdj_utils.exception.CustomExceptionHandler',
}

AUTHENTICATION_BACKENDS = [
    'xdj_utils.backends.CustomBackend',
    ...
]

SWAGGER_SETTINGS = {
    ...
    'DEFAULT_AUTO_SCHEMA_CLASS': 'xdj_utils.swagger.CustomSwaggerAutoSchema',
}

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

xdj-utils-0.0.6.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

xdj_utils-0.0.6-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file xdj-utils-0.0.6.tar.gz.

File metadata

  • Download URL: xdj-utils-0.0.6.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for xdj-utils-0.0.6.tar.gz
Algorithm Hash digest
SHA256 4780b89e181f2baed3be2afe6d9390a9862f0935e0d57dabd8b10760ec79c0c5
MD5 1e641531f708f4ee7ef48cbd9ff0e5f0
BLAKE2b-256 48acf083ef80398bd04eb634abdca9bcfd4d86d9e0687d7390a156f72e9f18b4

See more details on using hashes here.

File details

Details for the file xdj_utils-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: xdj_utils-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for xdj_utils-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 81242fdba0eb52683a68ed42238497acc6ab5262b8278b300c24313290c67b6f
MD5 e93613a128c48a909dfa367f64a5d6f3
BLAKE2b-256 7a50fa23ec6e7dc673e8564ffec1731a9f65b745e6aa65d5dc1428c79cdfaec3

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