관리-도구
편집 파일: __init__.cpython-311.pyc
� �܋f�U � � � d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl m Z d dlmZm Z d dlmZmZ d dlmZ d d lmZ d d lmZmZ d dlmZ d dlmZmZmZmZmZm Z m!Z!m"Z"m#Z# d d l$m%Z%m&Z& d dl'm(Z( d dl)m*Z* d dl+m,Z, d dl-m.Z/ d dl0m1Z2 d dl3m4Z4 d dl0m1Z1 d dl5m6Z6 n# e7$ r d dl8m6Z6 Y nw xY w d dl5m9Z9 n# e7$ r d dl8m9Z9 Y nw xY wn# e7$ r e&d� � �w xY wd dl:m;Z; d dl<m=Z=m>Z> d dl?m@Z@ d dlAmBZB d dlCmDZD e/dd� dk rd dlEmFZF ndZFe rZd dlGmHZH d d lGmIZI d d!lGmJZJ d d"lGmKZK d d#lGmLZL d d$lGmMZM d d%lNmOZO d d&lPmQZQ d d'lRmSZS d d(lTmUZU d d)lmVZV d d*lmWZW d d+l)mXZX d d,l mYZYmZZZm[Z[m\Z\ e/d-k rd.� Z]nd/� Z]d0Z^ G d1� d2e%� � Z_d3a` eja � � Zbd4� Zcd5� Zdd6� Zed7� Zfd8� Zgd9� Zhd:� Zid;� Zjd<� ZkdCd=�Zl G d>� d?e,� � Zmd@� ZndA� ZodB� ZpdS )D� )�absolute_importN)� import_module)�string_types)� TYPE_CHECKING)�OP�SPANDATA)�Hub�_should_send_default_pii)�add_global_event_processor)�add_global_repr_processor)�SOURCE_FOR_STYLE�TRANSACTION_SOURCE_URL)�record_sql_queries) �AnnotatedValue�HAS_REAL_CONTEXTVARS�CONTEXTVARS_ERROR_MESSAGE�SENSITIVE_DATA_SUBSTITUTE�logger�capture_internal_exceptions�event_from_exception�transaction_from_function�walk_exception_chain)�Integration�DidNotEnable)� ignore_logger)�SentryWsgiMiddleware)�RequestExtractor)�VERSION��settings)�signals)�resolve)�Resolver404zDjango not installed)�LEGACY_RESOLVER)�!get_template_frame_from_exception�patch_templates)�patch_django_middlewares)� patch_signals)�patch_views� �� � )� patch_caching)�Any)�Callable)�Dict)�Optional)�Union)�List)�WSGIRequest)�HttpResponse)� QueryDict)�MultiValueDict)�Span)�Scope)�_ScopedResponse)�Event�Hint�EventProcessor�NotImplementedType)r, � c �* � | � � � S �N��is_authenticated��request_users �^/opt/cloudlinux/venv/lib64/python3.11/site-packages/sentry_sdk/integrations/django/__init__.pyrD rD W s � ��,�,�.�.�.� c � � | j S rB rC rE s rG rD rD ] s � ��,�,rH )� function_name�urlc �H � e Zd ZdZdZdZdZdZ d d�Ze d� � � Z dS ) �DjangoIntegration�django� NrK TFc � � |t vrt d|�dt �d�� � �|| _ || _ || _ || _ d S )Nz%Invalid value for transaction_style: z (must be in �))�TRANSACTION_STYLE_VALUES� ValueError�transaction_style�middleware_spans� signals_spans�cache_spans)�selfrT rU rV rW s rG �__init__zDjangoIntegration.__init__m sd � � �$<�<�<��*�$�$�$�&>�&>�&>�@�� � � "3��� 0���*���&����rH c �D ��� t dk rt d� � �t � � t d� � t d� � ddlm� �j ���fd�} | �_ t � � t � � t j � t � � t d� � � }t d � � � }t � � t! � � t# � � t% � � t'