* 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.

22 lines
683 B

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