muhammadkhanusmanov / translate_bot

0 stars 3 forks source link

#1 Create Flask app #1

Open muhammadkhanusmanov opened 12 months ago

muhammadkhanusmanov commented 12 months ago

1 create flask app

samprit-ghosh commented 10 months ago
  1. 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
  2. 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)
  3. 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/.