edx-django-utils


Nameedx-django-utils JSON
Version 5.13.0 PyPI version JSON
download
home_pagehttps://github.com/openedx/edx-django-utils
SummaryEdX utilities for Django Application development.
upload_time2024-04-30 15:17:01
maintainerNone
docs_urlNone
authoredX
requires_pythonNone
licenseNone
keywords django edx
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            edx-django-utils
================

|pypi-badge| |ci-badge| |codecov-badge| |doc-badge| |pyversions-badge|
|license-badge| |status-badge|

EdX utilities for Django Application development.

Note that some utilities may warrant their own repository. A judgement call
needs to be made as to whether code properly belongs here or not. Please
review with the Architecture Team if you have any questions.

Purpose
-------

This repository includes shared utilities for:

* `Cache Utilities`_: Includes a RequestCache and a TieredCache.

* `Django User and Group Utilities`_: Includes user and group utilities.

* `IP Address Utilities`_: Utilities for handling request IP addresses.

* `Logging Utilities`_: Includes log filters and an encrypted logging helper.

* `Monitoring Utilities`_: Includes Middleware and utilities for enhanced monitoring.
  At this time, supports NewRelic monitoring.

* `Plugin Infrastructure`_: Enables enhanced Django Plugin capabilities.

* `Security Utilities`_: Includes a middleware to add CSP response headers.

* `Data Generation`_: Management command for generating Django data based on model factories.

.. _Cache Utilities: edx_django_utils/cache/README.rst

.. _Django User and Group Utilities: edx_django_utils/user/README.rst

.. _IP Address Utilities: edx_django_utils/ip/README.rst

.. _Logging Utilities: edx_django_utils/logging/README.rst

.. _Monitoring Utilities: edx_django_utils/monitoring/README.rst

.. _Plugin Infrastructure: edx_django_utils/plugins/README.rst

.. _Security Utilities: edx_django_utils/security/README.rst

.. _Data Generation: edx_django_utils/data_generation/README.rst

Documentation
-------------

The full documentation is in the docs directory, and is published to https://edx-django-utils.readthedocs.org.

Getting Started with Development
--------------------------------

Please see the Open edX documentation for `guidance on Python development <https://docs.openedx.org/en/latest/developers/how-tos/get-ready-for-python-dev.html>`_ in this repo.

Design Pattern followed by packages
-----------------------------------

All tools in edx_django_utils should expose their public api in their __init__.py files. This entails adding to __init__.py all functions/classes/constants/objects that are intended to be used by users of library.

Getting Help
------------

If you're having trouble, we have discussion forums at
`discuss.openedx.org <https://discuss.openedx.org>`_ where you can connect with others in the
community.

Our real-time conversations are on Slack. You can request a `Slack
invitation`_, then join our `community Slack workspace`_.

For anything non-trivial, the best path is to `open an issue`__ in this
repository with as many details about the issue you are facing as you
can provide.

__ https://github.com/openedx/django-config-models/issues

For more information about these options, see the `Getting Help`_ page.

.. _Slack invitation: https://openedx.org/slack
.. _community Slack workspace: https://openedx.slack.com/
.. _Getting Help: https://openedx.org/getting-help

How To Contribute
-----------------

Contributions are very welcome.

Please read `How To Contribute <https://github.com/openedx/.github/blob/master/CONTRIBUTING.md>`_ for details.

PR description template should be automatically applied if you are sending PR from github interface; otherwise you
can find it it at `PULL_REQUEST_TEMPLATE.md <https://github.com/openedx/edx-django-utils/blob/master/.github/PULL_REQUEST_TEMPLATE.md>`_

Issue report template should be automatically applied if you are sending it from github UI as well; otherwise you
can find it at `ISSUE_TEMPLATE.md <https://github.com/openedx/edx-django-utils/blob/master/.github/ISSUE_TEMPLATE.md>`_

This project is currently accepting all types of contributions, bug fixes, security fixes, maintenance work, or new features. However, please make sure to have a discussion about your new feature idea with the maintainers prior to beginning development to maximize the chances of your change being accepted. You can start a conversation by creating a new issue on this repo summarizing your idea.

Open edX Code of Conduct
------------------------
All community members are expected to follow the `Open edX Code of Conduct`_.

.. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/

People
------
The assigned maintainers for this component and other project details may be
found in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``
file in this repo.


.. _Backstage: https://backstage.openedx.org/catalog/default/component/edx-django-utils

Reporting Security Issues
-------------------------

Please do not report security issues in public. Please email security@openedx.org.

License
-------

The code in this repository is licensed under the Apache License, Version 2.0, unless
otherwise noted.

Please see ``LICENSE.txt`` for details.


.. |pypi-badge| image:: https://img.shields.io/pypi/v/edx-django-utils.svg
    :target: https://pypi.python.org/pypi/edx-django-utils/
    :alt: PyPI

.. |ci-badge| image:: https://github.com/openedx/edx-django-utils/workflows/Python%20CI/badge.svg?branch=master
    :target: https://github.com/openedx/edx-django-utils/actions?query=workflow%3A%22Python+CI%22
    :alt: CI

.. |codecov-badge| image:: http://codecov.io/github/edx/edx-django-utils/coverage.svg?branch=master
    :target: http://codecov.io/github/edx/edx-django-utils?branch=master
    :alt: Codecov

.. |doc-badge| image:: https://readthedocs.org/projects/edx-django-utils/badge/?version=latest
    :target: http://edx-django-utils.readthedocs.io/en/latest/
    :alt: Documentation

.. |pyversions-badge| image:: https://img.shields.io/pypi/pyversions/edx-django-utils.svg
    :target: https://pypi.python.org/pypi/edx-django-utils/
    :alt: Supported Python versions

.. |license-badge| image:: https://img.shields.io/github/license/edx/edx-django-utils.svg
    :target: https://github.com/openedx/edx-django-utils/blob/master/LICENSE.txt
    :alt: License

.. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
    :alt: Maintenance status


Change Log
==========

..
   All enhancements and patches to edx_django_utils will be documented
   in this file.  It adheres to the structure of https://keepachangelog.com/ ,
   but in reStructuredText instead of Markdown (for ease of incorporation into
   Sphinx documentation and the PyPI description).

   This project adheres to Semantic Versioning (https://semver.org/).

.. There should always be an "Unreleased" section for changes pending release.

[5.13.0] - 2024-04-30
---------------------
Added
~~~~~
* Initial support for sending monitoring data to OpenTelemetry collector or Datadog agent, configured by new Django setting ``OPENEDX_TELEMETRY``. See monitoring README for details.

[5.12.0] - 2024-03-29
---------------------
Added
~~~~~
* Added support for ``Python 3.11``

[5.11.0] - 2024-03-06
---------------------
Added
~~~~~
* Added support for ``Python 3.12``

Removed
~~~~~~~
* Dropped support for ``Django 3.2``

[5.10.1] - 2024-01-17
---------------------

Added
~~~~~
* Added manufacture_data management command

[5.9.0] - 2023-11-27
--------------------

Removed
~~~~~~~
* Removed ``edx_django_utils.cache.disable_forced_cache_miss_for_none`` which was added in ``5.7.0``.

[5.8.0] - 2023-11-03
--------------------

Changed
~~~~~~~
* Adjusted ``get_plugin_apps`` to log at info level rather than debug and with more detail, though with a comment that this may not actually end up logging.

[5.7.0] - 2023-08-04
--------------------

Added
~~~~~
* Support added for Django 4.2

Fixed
~~~~~
* Fixed bug where None was not properly being stored by TieredCache.
  For backward compatibility, ``edx_django_utils.cache.disable_forced_cache_miss_for_none`` waffle switch has
  been added, which defaults to the old broken behavior of treating None as a cache miss.

[5.6.0] - 2023-07-24
--------------------

Changed
~~~~~~~
* Updated and renamed new_relic_nrql_search to search in text widgets as well as NRQL queries

[5.5.0] - 2023-06-01
--------------------

Changed
~~~~~~~
* Switched to ``sphinx-book-theme`` as the new standard theme across all Open
  edX repos.  See https://github.com/openedx/edx-sphinx-theme/issues/184 for
  more details.
* CookieMonitoringMiddleware will now remove cookies based on a ``COOKIE_PREFIXES_TO_REMOVE`` setting


[5.4.0] - 2023-04-12
--------------------

Added
~~~~~

* Added Content-Security-Policy response header middleware under ``security/csp``

[5.3.0] - 2023-03-17
--------------------

Fixed
~~~~~

* Report both specified and existing email when refusing to create a user

[5.2.0] - 2022-10-06
--------------------

Added
~~~~~

* Added a wrapper for background_task in monitoring.

[5.1.0] - 2022-09-19
--------------------

Added
~~~~~

* Utilities for safely determining the IP address of a request: ``edx_django_utils.ip`` (moved from edx-platform)

[5.0.1] - 2022-09-09
--------------------

Changed
~~~~~~~

* License has been changed from AGPL v3 to Apache v2 to reflect existing policies

[5.0.0] - 2022-05-19
--------------------

Changed
~~~~~~~

* Corrupt cookie logging:

  * Make independent of other cookie logging; no longer needs to meet cookie size threshold or sampling rate.
  * **Breaking change**, although low impact: Setting name changed from ``UNUSUAL_COOKIE_SAMPLING_PUBLIC_KEY`` to ``UNUSUAL_COOKIE_HEADER_PUBLIC_KEY``.
  * New setting ``UNUSUAL_COOKIE_HEADER_LOG_CHUNK`` helps avoid truncated (non-decryptable) messages by splitting the output across multiple log messages.

[4.8.1] - 2022-05-06
--------------------

Added
~~~~~

* Added ability to log headers when a corrupted cookie is detected in a large (or sampled) cookie header

[4.8.0] - 2022-05-06
--------------------

Bad version -- tag does not match package version, not released to PyPI. Released as 4.8.1 instead.

[4.7.0] - 2022-05-05
--------------------

Added
~~~~~

* Added ``encrypt_for_log`` logging helper and ``log-sensitive`` CLI command for encrypted logging of sensitive information

[4.6.0] - 2022-03-16
--------------------

Added
~~~~~

* Added ``CookieMonitoringMiddleware`` for monitoring cookie header sizes and cookie sizes.

[4.5.0] - 2022-01-31
--------------------

Removed
~~~~~~~

* Removed Django22, 30 and 31 from CI

[4.4.2] - 2022-01-24
--------------------

Fixed
~~~~~

* No longer clear the ``RequestCache`` during the exception-handling phase (wait until response phase)

  * It turns out all the ``process_exception`` methods get called until one returns a response, and only *then* do the ``process_response`` methods start getting called. The result was that on exception, some middlewares were unable to use RequestCache'd values in their response phase.

Updated
~~~~~~~

* Replaced usage of 'django.conf.urls' with 'django.urls'

[4.4.1] - 2021-12-17
--------------------

Updated
~~~~~~~

* Replaced usage of 'django.conf.urls.url()' with 'django.urls.re_path()'

[4.4.0] - 2021-09-02
--------------------

Added
~~~~~

* Added ``DeploymentMonitoringMiddleware`` to record ``Python`` and ``Django`` versions in NewRelic with each transaction.

[4.3.0] - 2021-07-20
--------------------

Added
~~~~~

* Added user and group management utilities.

[4.2.0] - 2021-07-14
--------------------

Added
~~~~~

* Added support for Django 3.1 and 3.2

[4.1.0] - 2021-06-01
--------------------

Added
~~~~~

* Added mixin for a custom Django admin class which disables CRUD operation on the admin's model.

Added
~~~~~

* Script new_relic_nrql_search.py to search the NRQL in New Relic alert policies and dashboards using a supplied regex.

[4.0.0] - 2021-05-03
--------------------

Removed
~~~~~~~

* Removed the old location of ``CodeOwnerMonitoringMiddleware``. It had moved in a past commit. Although technically a breaking change, all references in the Open edX platform have already been updated to point to the new location.

Added
~~~~~

* Added new ``code_owner_theme`` and ``code_owner_squad`` custom attributes. This is useful in cases where the ``code_owner`` combines a theme and squad name, because monitoring can instead reference ``code_owner_squad`` to be resilient to theme name updates. For the decision doc, see edx_django_utils/monitoring/docs/decisions/0004-code-owner-theme-and-squad.rst.

Updated
~~~~~~~

* Misconfigurations of CODE_OWNER_MAPPINGS will now fail fast, rather than just logging. Although technically a breaking change, if CODE_OWNER_MAPPINGS is in use, it is probably correctly configured and this change should be a no-op.

[3.16.0] - 2021-03-24
---------------------

Added
~~~~~

* Added ``pluggable_override`` decorator.


[3.15.0] - 2021-03-02
---------------------

* Added chunked_queryset utility.

[3.14.0] - 2020-12-15
---------------------

Removed
~~~~~~~

* Dropped support for Python 3.5.


[3.13.0] - 2020-11-18
---------------------

Added
~~~~~

* Added record_exception to monitor caught exceptions.

Updated
~~~~~~~

* Added additional details to the `deprecated_monitoring_utils` custom attribute values to make it simpler to track down usage.

[3.12.0] - 2020-11-17
---------------------

Added
~~~~~

* Added set_code_owner_attribute decorator for use with celery tasks.
* Added set_code_owner_attribute_from_module as an alternative to the decorator.

Updated
~~~~~~~

* Cleaned up some of the code owner middleware code. In doing so, renamed custom attribute code_owner_path_module to code_owner_module. This may affect monitoring dashboards. Also slightly changed when error custom attributes are set.

[3.11.0] - 2020-10-31
---------------------

Added
~~~~~

* Added ADR 0004-public-api-and-app-organization.rst to explain a new app organization, which makes use of the public API more consistent.

Updated
~~~~~~~

* Applied the new app organization described in th ADR to the monitoring Django app.
* Moved CachedCustomMonitoringMiddleware, CodeOwnerMonitoringMiddleware, and MonitoringMemoryMiddleware to the public API.

Deprecated
~~~~~~~~~~

* Deprecated the old locations of CachedCustomMonitoringMiddleware, CodeOwnerMonitoringMiddleware, and MonitoringMemoryMiddleware.
* Deprecated various methods from modules that were always meant to be used from the public API.

  * accumulate
  * increment
  * set_custom_attribute
  * set_custom_attributes_for_course_key

* Added additional custom attributes for deprecated classes and methods to make them safer to retire.

.. note::

  Some method implementations that were available in the public API were moved without adding a deprecated equivalent. These were not found when searching, so hopefully they are only used via the public API, which did not change. This includes functions in ``transactions.py`` and ``code_owner/utils.py``.

Removed
~~~~~~~

* Removed the middleware ordering checks. This is not a typical Django feature and it is painful when refactoring.

[3.10.0] - 2020-10-28
---------------------

Added
~~~~~

* Added logging filter classes for users and remote IP addresses to be used by all IDAs. These were moved here from edx-platform.

[3.9.0] - 2020-10-21
--------------------

Updated
~~~~~~~

* Exposed existing get_code_owner_from_module via the public api.
* Fixed get_code_owner_from_module to not require a call to is_code_owner_mappings_configured beforehand.
* Set the existing code_owner_path_module custom attribute, even for cases where the transaction name was used, rather than the view module.
* Refactor code owner setting processing.

[3.8.0] - 2020-08-31
--------------------

Updated
~~~~~~~

* Renamed "custom metric" to "custom attribute" throughout the monitoring library. This decision can be read about in the ADR 0002-custom-monitoring-language.rst.  The following have been deprecated:

  * set_custom_metric (use set_custom_attribute)
  * set_custom_metrics_for_course_key (use set_custom_attributes_for_course_key)
  * MonitoringCustomMetricsMiddleware (use CachedCustomMonitoringMiddleware)
  * CachedCustomMonitoringMiddleware.accumulate_metric (use CachedCustomMonitoringMiddleware.accumulate_attribute)

    * This wasn't meant to be used publicly, but was deprecated just in case.

  * CodeOwnerMetricMiddleware (use CodeOwnerMonitoringMiddleware)

[3.7.4] - 2020-08-29
--------------------

* Fix to custom monitoring accumulate to actually accumulate rather than overwrite.

[3.7.3] - 2020-08-12
--------------------

Updated
~~~~~~~

* Upgrade psutil to latest version

[3.7.2] - 2020-08-10
--------------------

Updated
~~~~~~~

* Added missing classes to plugins public api. See ``plugins.__init__.py`` for latest api.
* Updated plugin method names to be more descriptive. See ``plugins.__init__.py`` for latest.

.. note:: Although these changes are backwards incompatible, they are being added as a bug fix because plugins code release (3.7.0) is not yet in use.

[3.7.1] - 2020-08-10
--------------------

Updated
~~~~~~~

* Exposing all public functions in edx_django_utils/plugins directory in its __init__.py file.
    * this was done to keep inline with standard/pattern used in other packages in edx_django_utils

[3.7.0] - 2020-08-10
--------------------

Added
~~~~~

* Adding Plugin infrastructure
    * Allows IDAs to use plugins

[3.6.0] - 2020-08-04
--------------------

Added
~~~~~

* Improved documentation for CodeOwnerMetricMiddleware, including a how_tos/add_code_owner_custom_metric_to_an_ida.rst for adding it to a new IDA.
* Added ignore_transaction monitoring utility to ignore transactions we don't want tracked.

Updated
~~~~~~~

* Moved transaction-related monitoring code into it's own file. Still exposed through `__init__.py` so it's a non-breaking change.

[3.5.0] - 2020-07-22
--------------------

Updated
~~~~~~~

* Added a catch-all capability to CodeOwnerMetricMiddleware when CODE_OWNER_MAPPINGS includes a '*' as a team's module. The catch-all is used only if there is no other match.

[3.4.0] - 2020-07-20
--------------------

Added
~~~~~

* Added get_current_transaction for monitoring that returns a transaction object with a name property.

Updated
~~~~~~~

* Updated CodeOwnerMetricMiddleware to use NewRelic's current transaction for cases where resolve() doesn't work to determine the code_owner, like for Middleware.

[3.3.0] - 2020-07-16
--------------------

Added
~~~~~

* CodeOwnerMetricMiddleware was moved here (from edx-platform) in order to be able to take advantage of the ``code_owner`` metric in other IDAs. For details on this decision, see the `ADR for monitoring code owner`_. See the docstring for more details on usage.

.. _ADR for monitoring code owner: https://github.com/openedx/edx-django-utils/blob/master/edx_django_utils/monitoring/docs/decisions/0001-monitoring-by-code-owner.rst

[3.2.3] - 2020-05-30
--------------------
* Removed ceninusepy3 usage.

[3.2.2] - 2020-05-04
--------------------
* Added support for python 3.8 and dropped support for Django versions older than 2.2

[3.2.1] - 2020-04-17
--------------------

Changed
~~~~~~~

* imported get_cache_key in cache/__init__.py.

[3.2.0] - 2020-04-09
--------------------

Added
~~~~~

* Added get_cache_key utility.

[2.0.1] - 2019-10-09
--------------------

Changed
~~~~~~~

* Fixed: Updated function tracing to accomodate changes in New Relic's 5.x Agent.

[2.0.0] - 2019-07-07
--------------------

Changed
~~~~~~~

* Converted Middleware (from old style MIDDLEWARE_CLASSES to MIDDLEWARE).
* Removed support for Django versions < 1.11

[1.0.1] - 2018-09-07
--------------------

Changed
~~~~~~~

* Fixed: RequestCache now properly uses thread.local.
* Fixed: CachedResponse.__repr__ now handles unicode.

[1.0.0] - 2018-08-28
--------------------

Added
~~~~~~~

* Add ``data`` dict property to better match legacy RequestCache interface.

Changed
~~~~~~~

* Change is_hit/is_miss to is_found.

[0.5.1] - 2018-08-17
--------------------

Changed
~~~~~~~

* Fixed bug in TieredCacheMiddleware dependency declaration.

[0.5.0] - 2018-08-16
--------------------

Changed
~~~~~~~

* Restored Python 3 support.
* Refactor/clean-up, including Middleware dependency checking.
* Docs updates and other cookiecutter updates.

[0.4.1] - 2018-08-10
--------------------

Changed
~~~~~~~

* Split out TieredCacheMiddleware from RequestCacheMiddleware.

[0.4.0] - 2018-08-10
--------------------

Changed
~~~~~~~

* Rename CacheUtilsMiddleware to RequestCacheMiddleware.

[0.3.0] - 2018-08-02
--------------------

Removed
~~~~~~~

* Temporarily dropped Python 3 support to land this.

[0.2.0] - 2018-08-01
--------------------

Added
~~~~~

* Added cache and monitoring utilities.


[0.1.0] - 2018-07-23
--------------------

Added
~~~~~

* First release on PyPI.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/openedx/edx-django-utils",
    "name": "edx-django-utils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "Django edx",
    "author": "edX",
    "author_email": "oscm@edx.org",
    "download_url": "https://files.pythonhosted.org/packages/66/20/2bf127292c66d2b0916fb7d155fb6e999d79c702399e0c55a9a30e61e858/edx-django-utils-5.13.0.tar.gz",
    "platform": null,
    "description": "edx-django-utils\n================\n\n|pypi-badge| |ci-badge| |codecov-badge| |doc-badge| |pyversions-badge|\n|license-badge| |status-badge|\n\nEdX utilities for Django Application development.\n\nNote that some utilities may warrant their own repository. A judgement call\nneeds to be made as to whether code properly belongs here or not. Please\nreview with the Architecture Team if you have any questions.\n\nPurpose\n-------\n\nThis repository includes shared utilities for:\n\n* `Cache Utilities`_: Includes a RequestCache and a TieredCache.\n\n* `Django User and Group Utilities`_: Includes user and group utilities.\n\n* `IP Address Utilities`_: Utilities for handling request IP addresses.\n\n* `Logging Utilities`_: Includes log filters and an encrypted logging helper.\n\n* `Monitoring Utilities`_: Includes Middleware and utilities for enhanced monitoring.\n  At this time, supports NewRelic monitoring.\n\n* `Plugin Infrastructure`_: Enables enhanced Django Plugin capabilities.\n\n* `Security Utilities`_: Includes a middleware to add CSP response headers.\n\n* `Data Generation`_: Management command for generating Django data based on model factories.\n\n.. _Cache Utilities: edx_django_utils/cache/README.rst\n\n.. _Django User and Group Utilities: edx_django_utils/user/README.rst\n\n.. _IP Address Utilities: edx_django_utils/ip/README.rst\n\n.. _Logging Utilities: edx_django_utils/logging/README.rst\n\n.. _Monitoring Utilities: edx_django_utils/monitoring/README.rst\n\n.. _Plugin Infrastructure: edx_django_utils/plugins/README.rst\n\n.. _Security Utilities: edx_django_utils/security/README.rst\n\n.. _Data Generation: edx_django_utils/data_generation/README.rst\n\nDocumentation\n-------------\n\nThe full documentation is in the docs directory, and is published to https://edx-django-utils.readthedocs.org.\n\nGetting Started with Development\n--------------------------------\n\nPlease see the Open edX documentation for `guidance on Python development <https://docs.openedx.org/en/latest/developers/how-tos/get-ready-for-python-dev.html>`_ in this repo.\n\nDesign Pattern followed by packages\n-----------------------------------\n\nAll tools in edx_django_utils should expose their public api in their __init__.py files. This entails adding to __init__.py all functions/classes/constants/objects that are intended to be used by users of library.\n\nGetting Help\n------------\n\nIf you're having trouble, we have discussion forums at\n`discuss.openedx.org <https://discuss.openedx.org>`_ where you can connect with others in the\ncommunity.\n\nOur real-time conversations are on Slack. You can request a `Slack\ninvitation`_, then join our `community Slack workspace`_.\n\nFor anything non-trivial, the best path is to `open an issue`__ in this\nrepository with as many details about the issue you are facing as you\ncan provide.\n\n__ https://github.com/openedx/django-config-models/issues\n\nFor more information about these options, see the `Getting Help`_ page.\n\n.. _Slack invitation: https://openedx.org/slack\n.. _community Slack workspace: https://openedx.slack.com/\n.. _Getting Help: https://openedx.org/getting-help\n\nHow To Contribute\n-----------------\n\nContributions are very welcome.\n\nPlease read `How To Contribute <https://github.com/openedx/.github/blob/master/CONTRIBUTING.md>`_ for details.\n\nPR description template should be automatically applied if you are sending PR from github interface; otherwise you\ncan find it it at `PULL_REQUEST_TEMPLATE.md <https://github.com/openedx/edx-django-utils/blob/master/.github/PULL_REQUEST_TEMPLATE.md>`_\n\nIssue report template should be automatically applied if you are sending it from github UI as well; otherwise you\ncan find it at `ISSUE_TEMPLATE.md <https://github.com/openedx/edx-django-utils/blob/master/.github/ISSUE_TEMPLATE.md>`_\n\nThis project is currently accepting all types of contributions, bug fixes, security fixes, maintenance work, or new features. However, please make sure to have a discussion about your new feature idea with the maintainers prior to beginning development to maximize the chances of your change being accepted. You can start a conversation by creating a new issue on this repo summarizing your idea.\n\nOpen edX Code of Conduct\n------------------------\nAll community members are expected to follow the `Open edX Code of Conduct`_.\n\n.. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/\n\nPeople\n------\nThe assigned maintainers for this component and other project details may be\nfound in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``\nfile in this repo.\n\n\n.. _Backstage: https://backstage.openedx.org/catalog/default/component/edx-django-utils\n\nReporting Security Issues\n-------------------------\n\nPlease do not report security issues in public. Please email security@openedx.org.\n\nLicense\n-------\n\nThe code in this repository is licensed under the Apache License, Version 2.0, unless\notherwise noted.\n\nPlease see ``LICENSE.txt`` for details.\n\n\n.. |pypi-badge| image:: https://img.shields.io/pypi/v/edx-django-utils.svg\n    :target: https://pypi.python.org/pypi/edx-django-utils/\n    :alt: PyPI\n\n.. |ci-badge| image:: https://github.com/openedx/edx-django-utils/workflows/Python%20CI/badge.svg?branch=master\n    :target: https://github.com/openedx/edx-django-utils/actions?query=workflow%3A%22Python+CI%22\n    :alt: CI\n\n.. |codecov-badge| image:: http://codecov.io/github/edx/edx-django-utils/coverage.svg?branch=master\n    :target: http://codecov.io/github/edx/edx-django-utils?branch=master\n    :alt: Codecov\n\n.. |doc-badge| image:: https://readthedocs.org/projects/edx-django-utils/badge/?version=latest\n    :target: http://edx-django-utils.readthedocs.io/en/latest/\n    :alt: Documentation\n\n.. |pyversions-badge| image:: https://img.shields.io/pypi/pyversions/edx-django-utils.svg\n    :target: https://pypi.python.org/pypi/edx-django-utils/\n    :alt: Supported Python versions\n\n.. |license-badge| image:: https://img.shields.io/github/license/edx/edx-django-utils.svg\n    :target: https://github.com/openedx/edx-django-utils/blob/master/LICENSE.txt\n    :alt: License\n\n.. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen\n    :alt: Maintenance status\n\n\nChange Log\n==========\n\n..\n   All enhancements and patches to edx_django_utils will be documented\n   in this file.  It adheres to the structure of https://keepachangelog.com/ ,\n   but in reStructuredText instead of Markdown (for ease of incorporation into\n   Sphinx documentation and the PyPI description).\n\n   This project adheres to Semantic Versioning (https://semver.org/).\n\n.. There should always be an \"Unreleased\" section for changes pending release.\n\n[5.13.0] - 2024-04-30\n---------------------\nAdded\n~~~~~\n* Initial support for sending monitoring data to OpenTelemetry collector or Datadog agent, configured by new Django setting ``OPENEDX_TELEMETRY``. See monitoring README for details.\n\n[5.12.0] - 2024-03-29\n---------------------\nAdded\n~~~~~\n* Added support for ``Python 3.11``\n\n[5.11.0] - 2024-03-06\n---------------------\nAdded\n~~~~~\n* Added support for ``Python 3.12``\n\nRemoved\n~~~~~~~\n* Dropped support for ``Django 3.2``\n\n[5.10.1] - 2024-01-17\n---------------------\n\nAdded\n~~~~~\n* Added manufacture_data management command\n\n[5.9.0] - 2023-11-27\n--------------------\n\nRemoved\n~~~~~~~\n* Removed ``edx_django_utils.cache.disable_forced_cache_miss_for_none`` which was added in ``5.7.0``.\n\n[5.8.0] - 2023-11-03\n--------------------\n\nChanged\n~~~~~~~\n* Adjusted ``get_plugin_apps`` to log at info level rather than debug and with more detail, though with a comment that this may not actually end up logging.\n\n[5.7.0] - 2023-08-04\n--------------------\n\nAdded\n~~~~~\n* Support added for Django 4.2\n\nFixed\n~~~~~\n* Fixed bug where None was not properly being stored by TieredCache.\n  For backward compatibility, ``edx_django_utils.cache.disable_forced_cache_miss_for_none`` waffle switch has\n  been added, which defaults to the old broken behavior of treating None as a cache miss.\n\n[5.6.0] - 2023-07-24\n--------------------\n\nChanged\n~~~~~~~\n* Updated and renamed new_relic_nrql_search to search in text widgets as well as NRQL queries\n\n[5.5.0] - 2023-06-01\n--------------------\n\nChanged\n~~~~~~~\n* Switched to ``sphinx-book-theme`` as the new standard theme across all Open\n  edX repos.  See https://github.com/openedx/edx-sphinx-theme/issues/184 for\n  more details.\n* CookieMonitoringMiddleware will now remove cookies based on a ``COOKIE_PREFIXES_TO_REMOVE`` setting\n\n\n[5.4.0] - 2023-04-12\n--------------------\n\nAdded\n~~~~~\n\n* Added Content-Security-Policy response header middleware under ``security/csp``\n\n[5.3.0] - 2023-03-17\n--------------------\n\nFixed\n~~~~~\n\n* Report both specified and existing email when refusing to create a user\n\n[5.2.0] - 2022-10-06\n--------------------\n\nAdded\n~~~~~\n\n* Added a wrapper for background_task in monitoring.\n\n[5.1.0] - 2022-09-19\n--------------------\n\nAdded\n~~~~~\n\n* Utilities for safely determining the IP address of a request: ``edx_django_utils.ip`` (moved from edx-platform)\n\n[5.0.1] - 2022-09-09\n--------------------\n\nChanged\n~~~~~~~\n\n* License has been changed from AGPL v3 to Apache v2 to reflect existing policies\n\n[5.0.0] - 2022-05-19\n--------------------\n\nChanged\n~~~~~~~\n\n* Corrupt cookie logging:\n\n  * Make independent of other cookie logging; no longer needs to meet cookie size threshold or sampling rate.\n  * **Breaking change**, although low impact: Setting name changed from ``UNUSUAL_COOKIE_SAMPLING_PUBLIC_KEY`` to ``UNUSUAL_COOKIE_HEADER_PUBLIC_KEY``.\n  * New setting ``UNUSUAL_COOKIE_HEADER_LOG_CHUNK`` helps avoid truncated (non-decryptable) messages by splitting the output across multiple log messages.\n\n[4.8.1] - 2022-05-06\n--------------------\n\nAdded\n~~~~~\n\n* Added ability to log headers when a corrupted cookie is detected in a large (or sampled) cookie header\n\n[4.8.0] - 2022-05-06\n--------------------\n\nBad version -- tag does not match package version, not released to PyPI. Released as 4.8.1 instead.\n\n[4.7.0] - 2022-05-05\n--------------------\n\nAdded\n~~~~~\n\n* Added ``encrypt_for_log`` logging helper and ``log-sensitive`` CLI command for encrypted logging of sensitive information\n\n[4.6.0] - 2022-03-16\n--------------------\n\nAdded\n~~~~~\n\n* Added ``CookieMonitoringMiddleware`` for monitoring cookie header sizes and cookie sizes.\n\n[4.5.0] - 2022-01-31\n--------------------\n\nRemoved\n~~~~~~~\n\n* Removed Django22, 30 and 31 from CI\n\n[4.4.2] - 2022-01-24\n--------------------\n\nFixed\n~~~~~\n\n* No longer clear the ``RequestCache`` during the exception-handling phase (wait until response phase)\n\n  * It turns out all the ``process_exception`` methods get called until one returns a response, and only *then* do the ``process_response`` methods start getting called. The result was that on exception, some middlewares were unable to use RequestCache'd values in their response phase.\n\nUpdated\n~~~~~~~\n\n* Replaced usage of 'django.conf.urls' with 'django.urls'\n\n[4.4.1] - 2021-12-17\n--------------------\n\nUpdated\n~~~~~~~\n\n* Replaced usage of 'django.conf.urls.url()' with 'django.urls.re_path()'\n\n[4.4.0] - 2021-09-02\n--------------------\n\nAdded\n~~~~~\n\n* Added ``DeploymentMonitoringMiddleware`` to record ``Python`` and ``Django`` versions in NewRelic with each transaction.\n\n[4.3.0] - 2021-07-20\n--------------------\n\nAdded\n~~~~~\n\n* Added user and group management utilities.\n\n[4.2.0] - 2021-07-14\n--------------------\n\nAdded\n~~~~~\n\n* Added support for Django 3.1 and 3.2\n\n[4.1.0] - 2021-06-01\n--------------------\n\nAdded\n~~~~~\n\n* Added mixin for a custom Django admin class which disables CRUD operation on the admin's model.\n\nAdded\n~~~~~\n\n* Script new_relic_nrql_search.py to search the NRQL in New Relic alert policies and dashboards using a supplied regex.\n\n[4.0.0] - 2021-05-03\n--------------------\n\nRemoved\n~~~~~~~\n\n* Removed the old location of ``CodeOwnerMonitoringMiddleware``. It had moved in a past commit. Although technically a breaking change, all references in the Open edX platform have already been updated to point to the new location.\n\nAdded\n~~~~~\n\n* Added new ``code_owner_theme`` and ``code_owner_squad`` custom attributes. This is useful in cases where the ``code_owner`` combines a theme and squad name, because monitoring can instead reference ``code_owner_squad`` to be resilient to theme name updates. For the decision doc, see edx_django_utils/monitoring/docs/decisions/0004-code-owner-theme-and-squad.rst.\n\nUpdated\n~~~~~~~\n\n* Misconfigurations of CODE_OWNER_MAPPINGS will now fail fast, rather than just logging. Although technically a breaking change, if CODE_OWNER_MAPPINGS is in use, it is probably correctly configured and this change should be a no-op.\n\n[3.16.0] - 2021-03-24\n---------------------\n\nAdded\n~~~~~\n\n* Added ``pluggable_override`` decorator.\n\n\n[3.15.0] - 2021-03-02\n---------------------\n\n* Added chunked_queryset utility.\n\n[3.14.0] - 2020-12-15\n---------------------\n\nRemoved\n~~~~~~~\n\n* Dropped support for Python 3.5.\n\n\n[3.13.0] - 2020-11-18\n---------------------\n\nAdded\n~~~~~\n\n* Added record_exception to monitor caught exceptions.\n\nUpdated\n~~~~~~~\n\n* Added additional details to the `deprecated_monitoring_utils` custom attribute values to make it simpler to track down usage.\n\n[3.12.0] - 2020-11-17\n---------------------\n\nAdded\n~~~~~\n\n* Added set_code_owner_attribute decorator for use with celery tasks.\n* Added set_code_owner_attribute_from_module as an alternative to the decorator.\n\nUpdated\n~~~~~~~\n\n* Cleaned up some of the code owner middleware code. In doing so, renamed custom attribute code_owner_path_module to code_owner_module. This may affect monitoring dashboards. Also slightly changed when error custom attributes are set.\n\n[3.11.0] - 2020-10-31\n---------------------\n\nAdded\n~~~~~\n\n* Added ADR 0004-public-api-and-app-organization.rst to explain a new app organization, which makes use of the public API more consistent.\n\nUpdated\n~~~~~~~\n\n* Applied the new app organization described in th ADR to the monitoring Django app.\n* Moved CachedCustomMonitoringMiddleware, CodeOwnerMonitoringMiddleware, and MonitoringMemoryMiddleware to the public API.\n\nDeprecated\n~~~~~~~~~~\n\n* Deprecated the old locations of CachedCustomMonitoringMiddleware, CodeOwnerMonitoringMiddleware, and MonitoringMemoryMiddleware.\n* Deprecated various methods from modules that were always meant to be used from the public API.\n\n  * accumulate\n  * increment\n  * set_custom_attribute\n  * set_custom_attributes_for_course_key\n\n* Added additional custom attributes for deprecated classes and methods to make them safer to retire.\n\n.. note::\n\n  Some method implementations that were available in the public API were moved without adding a deprecated equivalent. These were not found when searching, so hopefully they are only used via the public API, which did not change. This includes functions in ``transactions.py`` and ``code_owner/utils.py``.\n\nRemoved\n~~~~~~~\n\n* Removed the middleware ordering checks. This is not a typical Django feature and it is painful when refactoring.\n\n[3.10.0] - 2020-10-28\n---------------------\n\nAdded\n~~~~~\n\n* Added logging filter classes for users and remote IP addresses to be used by all IDAs. These were moved here from edx-platform.\n\n[3.9.0] - 2020-10-21\n--------------------\n\nUpdated\n~~~~~~~\n\n* Exposed existing get_code_owner_from_module via the public api.\n* Fixed get_code_owner_from_module to not require a call to is_code_owner_mappings_configured beforehand.\n* Set the existing code_owner_path_module custom attribute, even for cases where the transaction name was used, rather than the view module.\n* Refactor code owner setting processing.\n\n[3.8.0] - 2020-08-31\n--------------------\n\nUpdated\n~~~~~~~\n\n* Renamed \"custom metric\" to \"custom attribute\" throughout the monitoring library. This decision can be read about in the ADR 0002-custom-monitoring-language.rst.  The following have been deprecated:\n\n  * set_custom_metric (use set_custom_attribute)\n  * set_custom_metrics_for_course_key (use set_custom_attributes_for_course_key)\n  * MonitoringCustomMetricsMiddleware (use CachedCustomMonitoringMiddleware)\n  * CachedCustomMonitoringMiddleware.accumulate_metric (use CachedCustomMonitoringMiddleware.accumulate_attribute)\n\n    * This wasn't meant to be used publicly, but was deprecated just in case.\n\n  * CodeOwnerMetricMiddleware (use CodeOwnerMonitoringMiddleware)\n\n[3.7.4] - 2020-08-29\n--------------------\n\n* Fix to custom monitoring accumulate to actually accumulate rather than overwrite.\n\n[3.7.3] - 2020-08-12\n--------------------\n\nUpdated\n~~~~~~~\n\n* Upgrade psutil to latest version\n\n[3.7.2] - 2020-08-10\n--------------------\n\nUpdated\n~~~~~~~\n\n* Added missing classes to plugins public api. See ``plugins.__init__.py`` for latest api.\n* Updated plugin method names to be more descriptive. See ``plugins.__init__.py`` for latest.\n\n.. note:: Although these changes are backwards incompatible, they are being added as a bug fix because plugins code release (3.7.0) is not yet in use.\n\n[3.7.1] - 2020-08-10\n--------------------\n\nUpdated\n~~~~~~~\n\n* Exposing all public functions in edx_django_utils/plugins directory in its __init__.py file.\n    * this was done to keep inline with standard/pattern used in other packages in edx_django_utils\n\n[3.7.0] - 2020-08-10\n--------------------\n\nAdded\n~~~~~\n\n* Adding Plugin infrastructure\n    * Allows IDAs to use plugins\n\n[3.6.0] - 2020-08-04\n--------------------\n\nAdded\n~~~~~\n\n* Improved documentation for CodeOwnerMetricMiddleware, including a how_tos/add_code_owner_custom_metric_to_an_ida.rst for adding it to a new IDA.\n* Added ignore_transaction monitoring utility to ignore transactions we don't want tracked.\n\nUpdated\n~~~~~~~\n\n* Moved transaction-related monitoring code into it's own file. Still exposed through `__init__.py` so it's a non-breaking change.\n\n[3.5.0] - 2020-07-22\n--------------------\n\nUpdated\n~~~~~~~\n\n* Added a catch-all capability to CodeOwnerMetricMiddleware when CODE_OWNER_MAPPINGS includes a '*' as a team's module. The catch-all is used only if there is no other match.\n\n[3.4.0] - 2020-07-20\n--------------------\n\nAdded\n~~~~~\n\n* Added get_current_transaction for monitoring that returns a transaction object with a name property.\n\nUpdated\n~~~~~~~\n\n* Updated CodeOwnerMetricMiddleware to use NewRelic's current transaction for cases where resolve() doesn't work to determine the code_owner, like for Middleware.\n\n[3.3.0] - 2020-07-16\n--------------------\n\nAdded\n~~~~~\n\n* CodeOwnerMetricMiddleware was moved here (from edx-platform) in order to be able to take advantage of the ``code_owner`` metric in other IDAs. For details on this decision, see the `ADR for monitoring code owner`_. See the docstring for more details on usage.\n\n.. _ADR for monitoring code owner: https://github.com/openedx/edx-django-utils/blob/master/edx_django_utils/monitoring/docs/decisions/0001-monitoring-by-code-owner.rst\n\n[3.2.3] - 2020-05-30\n--------------------\n* Removed ceninusepy3 usage.\n\n[3.2.2] - 2020-05-04\n--------------------\n* Added support for python 3.8 and dropped support for Django versions older than 2.2\n\n[3.2.1] - 2020-04-17\n--------------------\n\nChanged\n~~~~~~~\n\n* imported get_cache_key in cache/__init__.py.\n\n[3.2.0] - 2020-04-09\n--------------------\n\nAdded\n~~~~~\n\n* Added get_cache_key utility.\n\n[2.0.1] - 2019-10-09\n--------------------\n\nChanged\n~~~~~~~\n\n* Fixed: Updated function tracing to accomodate changes in New Relic's 5.x Agent.\n\n[2.0.0] - 2019-07-07\n--------------------\n\nChanged\n~~~~~~~\n\n* Converted Middleware (from old style MIDDLEWARE_CLASSES to MIDDLEWARE).\n* Removed support for Django versions < 1.11\n\n[1.0.1] - 2018-09-07\n--------------------\n\nChanged\n~~~~~~~\n\n* Fixed: RequestCache now properly uses thread.local.\n* Fixed: CachedResponse.__repr__ now handles unicode.\n\n[1.0.0] - 2018-08-28\n--------------------\n\nAdded\n~~~~~~~\n\n* Add ``data`` dict property to better match legacy RequestCache interface.\n\nChanged\n~~~~~~~\n\n* Change is_hit/is_miss to is_found.\n\n[0.5.1] - 2018-08-17\n--------------------\n\nChanged\n~~~~~~~\n\n* Fixed bug in TieredCacheMiddleware dependency declaration.\n\n[0.5.0] - 2018-08-16\n--------------------\n\nChanged\n~~~~~~~\n\n* Restored Python 3 support.\n* Refactor/clean-up, including Middleware dependency checking.\n* Docs updates and other cookiecutter updates.\n\n[0.4.1] - 2018-08-10\n--------------------\n\nChanged\n~~~~~~~\n\n* Split out TieredCacheMiddleware from RequestCacheMiddleware.\n\n[0.4.0] - 2018-08-10\n--------------------\n\nChanged\n~~~~~~~\n\n* Rename CacheUtilsMiddleware to RequestCacheMiddleware.\n\n[0.3.0] - 2018-08-02\n--------------------\n\nRemoved\n~~~~~~~\n\n* Temporarily dropped Python 3 support to land this.\n\n[0.2.0] - 2018-08-01\n--------------------\n\nAdded\n~~~~~\n\n* Added cache and monitoring utilities.\n\n\n[0.1.0] - 2018-07-23\n--------------------\n\nAdded\n~~~~~\n\n* First release on PyPI.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "EdX utilities for Django Application development.",
    "version": "5.13.0",
    "project_urls": {
        "Homepage": "https://github.com/openedx/edx-django-utils"
    },
    "split_keywords": [
        "django",
        "edx"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "227cf1ad5a6ac1e5c68bd67fac59ec92519ddfa8d99d13c61c03270214dd01bc",
                "md5": "f8224f1ad68c2bf2c7b7d05f0598d560",
                "sha256": "0b09c486da4654ea39b5def7dc33ed219047426fc5cb3817377108d2ebacc7e0"
            },
            "downloads": -1,
            "filename": "edx_django_utils-5.13.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f8224f1ad68c2bf2c7b7d05f0598d560",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 117675,
            "upload_time": "2024-04-30T15:16:58",
            "upload_time_iso_8601": "2024-04-30T15:16:58.919146Z",
            "url": "https://files.pythonhosted.org/packages/22/7c/f1ad5a6ac1e5c68bd67fac59ec92519ddfa8d99d13c61c03270214dd01bc/edx_django_utils-5.13.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66202bf127292c66d2b0916fb7d155fb6e999d79c702399e0c55a9a30e61e858",
                "md5": "17bfb1d32a9aded41fdea4b1338fa0c1",
                "sha256": "7456cb45ead5f40d84b3b4ea94bcd8fa07dd72337f7ba2912eac84663c3fbc30"
            },
            "downloads": -1,
            "filename": "edx-django-utils-5.13.0.tar.gz",
            "has_sig": false,
            "md5_digest": "17bfb1d32a9aded41fdea4b1338fa0c1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 103350,
            "upload_time": "2024-04-30T15:17:01",
            "upload_time_iso_8601": "2024-04-30T15:17:01.123678Z",
            "url": "https://files.pythonhosted.org/packages/66/20/2bf127292c66d2b0916fb7d155fb6e999d79c702399e0c55a9a30e61e858/edx-django-utils-5.13.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-30 15:17:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openedx",
    "github_project": "edx-django-utils",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "edx-django-utils"
}
        
edX
Elapsed time: 0.25308s