How to set image in carousel using flask?

How to set image in carousel using flask?

flask by aryadrj


Step 1:

  • Create one folder on the desktop called myFlask.

Step 2:

  • Create Two folder called static and templates in the myFlask folder.
  • Create one file called main.py in the myFlask folder.

Step 3:

  • Add the code in the main.py file.

    from flask import Flask,render_template
    app = Flask(__name__)

    @app.route('/')
    def hello_world():
        return render_template("index.html")

    app.run(debug=True)

Step 4:

  • Create image folder in the static folder.
  • Add one image in the image folder. [arya.png].

Step 5:

  • Create index.html in the templates folder and add the below code in that folder.
<html>
.
.
.

<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
    <img src="{{url_for('static', filename='arya.png')}}" class="d-block w-100">
</div>
<div class="carousel-item">
   <img src="{{url_for('static', filename='arya.png')}}" class="d-block w-100">
 </div>
<div class="carousel-item">
   <img src="{{url_for('static', filename='arya.png')}}" class="d-block w-100">
</div>
</div>
</div>
.
.
.
</html>


Folder Structure looks like:

How to set image in carousel in the flask?



Comments

  1. King Casino Login | All your games online and - Community Khabar
    Login King https://vannienailor4166blog.blogspot.com/ Casino, Play, and Win! Login King Casino, Play. Login King Casino, communitykhabar Play. Login King https://septcasino.com/review/merit-casino/ Casino, Play. Login septcasino King Casino, Play. Login King 1등 ė‚ŽėīíŠļ Casino, Play. Login King Casino,

    ReplyDelete

  2. "I resonate with many of the ideas expressed in this article. If you're in search of Social Distancing Signs, explore Fabsigns. I applaud the effort you've invested in this, and I encourage you to keep contributing to this subject. Consider exploring effective solutions at Liberating Solution."

    ReplyDelete

Post a Comment

Popular posts from this blog

Invalid syntax , perhaps you forgot a comma? Error in Python

How to run PL/SQL Code With Command Line?