관리-도구
편집 파일: __init__.cpython-37.pyc
B T a�? � @ s� d dl mZ d dlZd dlZd dlZd dlmZ d dlmZm Z d dl mZ d dlm Z d dlmZ d dlmZmZmZmZmZmZmZ d d lmZmZ d d lmZ d dlmZ d dlm Z yPd d l!m"Z# d dl$m%Z% yd dl&m'Z' W n" e(k �r d dl)m'Z' Y nX W n e(k �r* ed��Y nX d dl*m+Z+ d dl,m-Z-m.Z. d dl/m0Z0 d dl1m2Z2 e�rd dl3m4Z4 d dl3m5Z5 d dl3m6Z6 d dl3m7Z7 d dl3m8Z8 d dl3m9Z9 d dl:m;Z; d dl<m=Z= d dl>m?Z? d dl@mAZA d dlmBZB d d lmCZCmDZDmEZEmFZF e#d!k �rd"d#� ZGnd$d#� ZGd%ZHG d&d'� d'e�ZId(aJe�K� ZLd)d*� ZMd+d,� ZNd-d.� ZOd/d0� ZPd1d2� ZQd3d4� ZRd=d5d6�ZSG d7d8� d8e �ZTd9d:� ZUd;d<� ZVdS )>� )�absolute_importN)�MYPY)�Hub�_should_send_default_pii)�add_global_event_processor)�add_global_repr_processor)�record_sql_queries)�HAS_REAL_CONTEXTVARS�CONTEXTVARS_ERROR_MESSAGE�logger�capture_internal_exceptions�event_from_exception�transaction_from_function�walk_exception_chain)�Integration�DidNotEnable)� ignore_logger)�SentryWsgiMiddleware)�RequestExtractor)�VERSION)�signals)�resolvezDjango not installed)�LEGACY_RESOLVER)�!get_template_frame_from_exception�patch_templates)�patch_django_middlewares)�patch_views)�Any)�Callable)�Dict)�Optional)�Union)�List)�WSGIRequest)�HttpResponse)� QueryDict)�MultiValueDict)�_ScopedResponse)�Event�Hint�EventProcessor�NotImplementedType)� � c C s | � � S )N)�is_authenticated)�request_user� r0 �X/opt/alt/python37/lib/python3.7/site-packages/sentry_sdk/integrations/django/__init__.pyr. C s r. c C s | j S )N)r. )r/ r0 r0 r1 r. J s )� function_name�urlc @ s. e Zd ZdZdZdZd dd�Zedd� �ZdS ) �DjangoIntegration�djangoNr3 Tc C s( |t krtd|t f ��|| _|| _d S )Nz7Invalid value for transaction_style: %s (must be in %s))�TRANSACTION_STYLE_VALUES� ValueError�transaction_style�middleware_spans)�selfr8 r9 r0 r0 r1 �__init__X s zDjangoIntegration.__init__c s� t dk rtd��t� td� td� ddlm� � j�� �fdd�} | � _t� t� t j �t� t d d � �}tdd� �}t� t� t� t� d S ) N)r, � z Django 1.6 or newer is required.z django.serverzdjango.requestr )�WSGIHandlerc sJ t j�t�d kr�| ||�S ��| � �}ddlm} |j}t||�||�S )Nr )�settings) r �current�get_integrationr4 �__get__Zdjango.confr>