From 4c0afe65d961e290b2b6fa33b297b743b37d25fd Mon Sep 17 00:00:00 2001 From: waweruvincent146-afk Date: Wed, 12 Nov 2025 08:51:32 +0300 Subject: [PATCH] docs: Improve Quickstart example clarity for beginners - Added explicit file naming instructions - Enhanced code comments for better understanding - Included if __name__ == '__main__' pattern - Clarified where to save the application file --- docs/quickstart.rst | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 6af09eb6..d8855acb 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -6,19 +6,25 @@ Follow :doc:`installation` to set up a project and install Flask first. A Minimal Application ---------------------- +===================== -A minimal Flask application looks something like this: +A minimal Flask application looks something like this. -.. code-block:: python +Save this code in a file named ``app.py``:: from flask import Flask + # Create a Flask application instance app = Flask(__name__) - @app.route("/") - def hello_world(): - return "

Hello, World!

" + @app.route('/') + def hello(): + return 'Hello, World!' + + # Run the application + if __name__ == '__main__': + app.run(debug=True) + So what did that code do?