Open muhammadkhanusmanov opened 12 months ago
Install Flask:
Ensure you have Python installed on your system. You can install Flask using pip
, the Python package installer. Open your terminal or command prompt and run the following command:
pip install Flask
Create a Python Script:
Inside your app directory, create a Python script (e.g., app.py
) with the following content:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
if __name__ == '__main__':
app.run(debug=True)
Run Your Flask App: In the terminal, run the following command to start your Flask app:
python app.py
This will start the development server, and you should see output indicating that the server is running. By default, your app will be accessible at http://127.0.0.1:5000/
or http://localhost:5000/
.
1 create flask app