Comments (7)
Yes, you can use the --debug
command line flag or set the DEBUG
environment variable to TRUE
.
from functions-framework-python.
I saw the --debug TRUE
switch in #5 and used it to debug my functions; it does not automatically reload the main.py after I modify it: I have to stop function-framework and start it again
from functions-framework-python.
Can you give us some more details about how you're trying to run the functions-framework
? The following works for me
$ cat main.py
def hello(request):
return "Hello world!"
$ functions-framework --target hello --debug TRUE
* Serving Flask app "hello" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
* Restarting with fsevents reloader
* Debugger is active!
* Debugger PIN: 137-358-281
<wrote to main.py>
* Detected change in '/Users/dustiningram/main.py', reloading
* Detected change in '/Users/dustiningram/main.py', reloading
* Restarting with fsevents reloader
* Debugger is active!
* Debugger PIN: 137-358-281
$ flask --version
Python 3.7.4
Flask 1.1.1
Werkzeug 0.16.0
from functions-framework-python.
Hi Dustin, here is a video of what I am doing: https://drive.google.com/file/d/1BJx4Bmc2YN4sgLTKDRSbqo-EdX1TZomj/preview
Is there any other detail that can help you?
from functions-framework-python.
Hi @ilpersi, thanks for the very detailed video! One difference is that Flask/Werkzeug is using the "stat" reloader on your machine, but I'm using "fsevents" which comes from the watchdog package.
It seems like what Flask uses varies from one platform to another. Could you try installing watchdog in your environment and see if that helps?
Also if you could include the output of flask --version
that'd be great. Thanks!
from functions-framework-python.
@di installing watchdog solves the issue! 🔝 👍
Here is my flask --version
Python 3.7.4
Flask 1.1.1
Werkzeug 0.16.0
I think that Flask version is also something that deserves more documentation: to stick with the cloud functions runtime I originally installed 1.0.2. and I updated to 1.1.1 after you posted your flask --version
as an attempt to fix the issue.
The video in the previous comment is shot with 1.1.1 and installing watchdog fixes the issue both with 1.0.2 and 1.1.1 (I tested them both).
Thank you very much.
from functions-framework-python.
FYI, once #15 is released, this will just be a flag (--debug
) instead of an option (--debug TRUE
).
from functions-framework-python.
Related Issues (20)
- Unit tests are failing
- Code behaves differently with debug flag HOT 2
- The framework default Gunicorn configs do not make sense for Gen2 environments HOT 5
- remove requirement for requirements.txt when specifying dependencies for deploying to functions: support poetry HOT 3
- Exception has occurred: SystemExit 3 HOT 6
- Symbolic linking within the Source Directory to include shared local directories.
- Firebase Functions Support HOT 1
- Possibility for multiple target/signature-type pairs?
- Gunicorn 21 is out HOT 3
- Flask Celery worker raise RuntimeError(unbound_message) from None RuntimeError: Working outside of request context. HOT 2
- Add Flask 3 support HOT 2
- README.md - Flask "Request" object hyperlink is broken HOT 2
- Native support for Pydantic models for function_framework.typed
- Document functions_framework.typed
- Support for postponed annnotations
- Improve developer experience for uncaught exceptions on GCP HOT 1
- PyPi development status alpha and other classifiers HOT 1
- functions-framework and tuning gunicorn HOT 1
- enhance framework to support pull subscriptions in addition to push subscriptions with pubsub
- Memory leaks? HOT 2
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 functions-framework-python.