일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- aws
- Android
- nginx-media-server
- golang
- dart
- HLS
- spring cloud config
- RTMP
- Java
- Shell script
- aws cli
- deployment
- Flutter
- configmap
- kubectl
- Kubernetes
- Sysinternals
- Windows10
- namespace
- VSCode
- wireshark
- android studio
- service
- Pod
- Python
- ebpf
- 행정구역분류
- ffmpeg
- docker
- macos
Archives
- Today
- Total
woonizzooni
locust 실행시 jinja2.ext.do의 KeyError: 'extensions' 에러 본문
Programming/Python
locust 실행시 jinja2.ext.do의 KeyError: 'extensions' 에러
woonizzooni 2021. 5. 12. 14:05
아래와 같은 에러 발생시
app.jinja_options["extensions"].append("jinja2.ext.do")
KeyError: 'extensions'
$ .venv/bin/locust -f service.py --host="http://localhost:8080" -P 8088
Traceback (most recent call last):
File "/Users/.../tools/kk/.venv/bin/locust", line 8, in
sys.exit(main())
File "/Users/.../tools/kk/.venv/lib/python3.9/site-packages/locust/main.py", line 286, in main
web_ui = environment.create_web_ui(
File "/Users/.../tools/kk/.venv/lib/python3.9/site-packages/locust/env.py", line 170, in create_web_ui
self.web_ui = WebUI(
File "/Users/.../tools/kk/.venv/lib/python3.9/site-packages/locust/web.py", line 102, in __init__
app.jinja_options["extensions"].append("jinja2.ext.do")
KeyError: 'extensions'
문제의 파일 web.py을 열고 102라인을 아래와 같이 변경 : app.jinja_env.add_extension('jinja2.ext.do')
68 def __init__(
69 self,
70 environment,
71 host,
72 port,
73 auth_credentials=None,
74 tls_cert=None,
75 tls_key=None,
76 stats_csv_writer=None,
77 delayed_start=False,
78 ):
79 """
80 Create WebUI instance and start running the web server in a separate greenlet (self.greenlet)
81
82 Arguments:
83 environment: Reference to the current Locust Environment
84 host: Host/interface that the web server should accept connections to
85 port: Port that the web server should listen to
86 auth_credentials: If provided, it will enable basic auth with all the routes protected by default.
87 Should be supplied in the format: "user:pass".
88 tls_cert: A path to a TLS certificate
89 tls_key: A path to a TLS private key
90 delayed_start: Whether or not to delay starting web UI until `start()` is called. Delaying web UI start
91 allows for adding Flask routes or Blueprints before accepting requests, avoiding errors.
92 """
100 app = Flask(__name__)
101 self.app = app
102 app.jinja_options["extensions"].append("jinja2.ext.do")
--> app.jinja_env.add_extension('jinja2.ext.do')
[참고]
'Programming > Python' 카테고리의 다른 글
[Python] dict -> ['(key, value)'] sorted array 만들기 (value로 > 그 이후 key로) (0) | 2020.10.10 |
---|---|
[Python] 대한민국 행정동 데이터 MySQL DB 테이블 생성 예시 (1) | 2019.09.05 |
PyQt5 설치 (Windows 환경에서) (0) | 2019.08.24 |
대한민국 행정동 경계 좌표 추출 #2 - python > GeoJSON (1) | 2019.08.23 |
[PyProj] Proj executable not found. Please set PROJ_DIR variable. (0) | 2019.08.22 |
Comments