Comments (6)
Hello, I think the issue is that you have combined imports in from quart import Quart,flask_patch
, rather I think you should have import quart.flask_patch
first before any other imports. I've hopefully made this clear in these docs.
from quart.
Hello Again,
I'm following your process steps but It's not change anything. I moved app=Quart("test")
to first row processed in run.py.
It works succesfully to default but it's return again the same error on docker.
New code block :
# coding:utf-8
from quart import flask_patch
from quart import (
Quart,
Blueprint,
session,
request,
render_template,
jsonify
)
app = Quart("test")
from app import create_app
app = create_app(app=app)
app.run(host='0.0.0.0', port=5001, threaded=True, debug=True)
and same error
Recreating seffaflik_seffaflik_1 ... done
Attaching to seffaflik_seffaflik_1
seffaflik_1 | Traceback (most recent call last):
seffaflik_1 | File "run.py", line 4, in <module>
seffaflik_1 | from quart import flask_patch
seffaflik_1 | File "/usr/local/lib/python3.6/site-packages/quart/flask_patch/__init__.py", line 5, in <module>
seffaflik_1 | patch_all()
seffaflik_1 | File "/usr/local/lib/python3.6/site-packages/quart/flask_patch/_patch.py", line 83, in patch_all
seffaflik_1 | _patch_modules()
seffaflik_1 | File "/usr/local/lib/python3.6/site-packages/quart/flask_patch/_patch.py", line 64, in _patch_modules
seffaflik_1 | for name, module in sys.modules.items():
seffaflik_1 | RuntimeError: dictionary changed size during iteration
seffaflik_seffaflik_1 exited with code 1
from quart.
Hmm, I can't seem to reproduce this. Is this the main file or is it imported from another? In addition is import quart.flask_patch
the very first line (bar comments) in the file? Also can you try with import quart.flask_path
rather than the from version?
from quart.
Yes this code is main file. I'm running this code with python run.py. And I changed from quart import flask_patch the import quart.flask_patch but I get the same error. When I look at the flask extensions you support , I use flask-mongoengine library you do not support. Actually I work in normal mode without any trouble, but I get an error on the docker.And I import this mongoengine after import quart.flask_patch.
And there is one more thing. If I delete import quart.flask_patch on default mode then I get this following error
Traceback (most recent call last):
File "run.py", line 6, in <module>
app = create_app()
File "/home/hanbey/workspaces/python/seffaflik/app/app.py", line 51, in create_app
configure_extensions(app)
File "/home/hanbey/workspaces/python/seffaflik/app/app.py", line 74, in configure_extensions
db.init_app(app)
File "/home/hanbey/.local/share/virtualenvs/seffaflik-2oDz6vDS/lib/python3.6/site-packages/flask_mongoengine/__init__.py", line 111, in init_app
raise Exception('Invalid Flask application instance')
Exception: Invalid Flask application instance
So I can not delete import quart.flask_patch.
from quart.
I think this should be fixed with 0c64f50, could you try it?
from quart.
I'm going to assume this is fixed in the latest release, 0.6.5, please reopen if it isn't.
from quart.
Related Issues (20)
- support insecure bind HOT 2
- Cannot load `QUART_` prefixed environment variables HOT 1
- AttributeError: 'Config' object has no attribute 'from_json' HOT 1
- async function support in url_defaults and url_value_preprocessor HOT 1
- incorrect display img logo on https://quart.palletsprojects.com/en/latest/ HOT 1
- Remove poetry from examples in documentation HOT 2
- Allow kwargs in Quart.test_client for custom test client implementations HOT 1
- unix socket support HOT 1
- reload() puts comman name after command line arguments HOT 2
- Hot reload does not work within poetry scripts HOT 2
- New doc contribution: Add a doc to integrate Quart with BentoML HOT 1
- The parameter of ContentRange in quart.wrappers.Response._process_range_request is not correct.
- Handling CTRL+C for websockets [linux] HOT 2
- 'quart.app' vs 'app' for log level configuration via dictConfig
- [Docs] AttributeError: 'async_generator' object has no attribute 'test_client'
- after_this_websocket is not called if the client disconnects?
- Background tasks can disappear mid-execution HOT 1
- Server sent events guide: Add = None to optional retry argument
- Cannot get request files with NGINX HOT 1
- Hot-reload not working on paths with spaces
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quart.