* Deploy Virtual Bussiness card.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
660 B

8 months ago
  1. #!/bin/python3
  2. from flask import Flask, render_template
  3. import qrcode
  4. import os
  5. app = Flask(__name__, template_folder="templates")
  6. @app.route('/')
  7. def index():
  8. # Generate QR code
  9. qr = qrcode.QRCode(version=1, box_size=10, border=5)
  10. qr.add_data("localhost") # You can replace this URL with any link you want
  11. qr.make(fit=True)
  12. qr_img = qr.make_image(fill_color="black", back_color="white")
  13. qr_img = qr.make_image(fill_color="black", back_color="white")
  14. qr_img.save("/home/anpham/Projects/virtual-bussiness-card/static/qr_code.png") # Save QR code image
  15. return render_template('index.html')
  16. if __name__ == '__main__':
  17. app.run(debug=True)