We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd5062d commit 771df57Copy full SHA for 771df57
sogs/web.py
@@ -2,13 +2,8 @@
2
3
app = flask.Flask(__name__)
4
5
-from . import logging # noqa: F401, E402
6
-from . import routes # noqa: F401, E402
7
-from . import onion_request # noqa: F401, E402
8
-from . import legacy_routes # noqa: F401, E402
9
-from . import cleanup # noqa: F401, E402
10
-
11
-# Monkey-patch app.get/post/etc. for Flask <2 compatibility
+# Monkey-patch app.get/post/etc. for Flask <2 compatibility; this has to be before the imports,
+# below, because they depend on this existing.
12
if not hasattr(flask.Flask, 'post'):
13
14
def _add_flask_method(name):
@@ -19,3 +14,9 @@ def meth(self, rule: str, **options):
19
20
15
for method in ('get', 'post', 'put', 'delete', 'patch'):
21
16
_add_flask_method(method)
17
+
18
+from . import logging # noqa: F401, E402
+from . import routes # noqa: F401, E402
+from . import onion_request # noqa: F401, E402
+from . import legacy_routes # noqa: F401, E402
22
+from . import cleanup # noqa: F401, E402
0 commit comments