Comments (3)
Hi there,
I managed to get it working by binding to 0.0.0.0
using the host
parameter. My app.py
is as follows:
from quart import Quart
app = Quart(__name__)
@app.route('/')
async def hello():
return 'hello world!!'
app.run(host='0.0.0.0')
Silly of me. Thank you for your time!
from quart.
Hmm, it looks good (I don't really know about docker-compose though). Can you get the logs from the container? It should print that it is serving or print an error.
from quart.
Thanks for getting back to me.
The logs for the container are empty. It seems to get stuck at the attaching stage.
docker-compose
has a --verbose
option, which I tried. The messages displayed seem nearly identical to when I ran the same for a Flask container with identical setup, except for minimal changes in the requirements.txt
and app.py
files.
This is for the Flask container (trimmed):
Creating api-play_app_1 ... done
compose.parallel.feed_queue: Pending: set()
compose.parallel.parallel_execute_iter: Finished processing: <Service: app>
compose.parallel.feed_queue: Pending: set()
Attaching to api-play_app_1
compose.cli.verbose_proxy.proxy_callable: docker events <- (filters={'label': ['com.docker.compose.project=api-play', 'com.docker.compose.oneoff=False']}, decode=True)
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/events?filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dapi-play%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker events -> <docker.types.daemon.CancellableStream object at 0x104476da0>
app_1 | * Serving Flask app "app" (lazy loading)
app_1 | * Environment: production
app_1 | WARNING: Do not use the development server in a production environment.
app_1 | Use a production WSGI server instead.
app_1 | * Debug mode: on
app_1 | * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
app_1 | * Restarting with stat
app_1 | * Debugger is active!
app_1 | * Debugger PIN: 174-318-941
And this is for the Quart container (trimmed):
Creating api-test_api_1 ... done
compose.parallel.feed_queue: Pending: set()
compose.parallel.parallel_execute_iter: Finished processing: <Service: api>
compose.parallel.feed_queue: Pending: set()
Attaching to api-test_api_1
compose.cli.verbose_proxy.proxy_callable: docker events <- (filters={'label': ['com.docker.compose.project=api-test', 'com.docker.compose.oneoff=False']}, decode=True)
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/events?filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dapi-test%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker events -> <docker.types.daemon.CancellableStream object at 0x101ed2f28>
The final few lines seem to be missing.
from quart.
Related Issues (20)
- Program not closing on Ctrl+C on Windows
- cannot import name 'url_quote' from 'werkzeug.urls' HOT 4
- fail pytest HOT 1
- Should `quart.make_response` be typed as returning `Response`?
- Task was destroyed but it is pending!
- `get_template_attribute` is not available in async mode HOT 1
- is_coroutine_function missing error with latest release 0.19.4 HOT 1
- TypeError: cannot use a string pattern on a bytes-like object HOT 1
- Add support mount other ASGI applications HOT 1
- Support after_response
- How to share websocket context in quart
- app.teardown_websocket no longer exists HOT 2
- Enhancing Blueprint Lifecycle Order
- ResourceWarning from `DataBody.__aiter__` HOT 1
- ResourceWarning: Unclosed file <tempfile.SpooledTemporaryFile object at 0...> in form handling HOT 1
- Server sent events seem to be capped at 6 connections HOT 1
- DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). HOT 2
- support insecure bind HOT 2
- Cannot load `QUART_` prefixed environment variables HOT 1
- AttributeError: 'Config' object has no attribute 'from_json' HOT 1
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.