fix: 🐛 Fix a bug with the QR code that always generate a QR code for localhost

Add an env variable and change README
This commit is contained in:
2024-07-01 18:01:04 +02:00
parent f057ed6374
commit d97dfafaa7
3 changed files with 3 additions and 1 deletions

View File

@ -44,7 +44,7 @@ def create_playlist():
cursor.execute("INSERT INTO rooms (roomid, spotify_id, playlist_name, spotify_URL) VALUES (?, ?, ?, ?)",
(roomid, playlistID, playlistName, spotifyURL))
database.commit()
qrcode = generateQRCode("http://localhost:3000/search/" + str(roomid))
qrcode = generateQRCode(os.getenv("hostname") + "/search/" + str(roomid))
return render_template("create.html", response="Playlist created successfully",
comment="Enjoy the night \U0001f57a (and share this QRCode with your friends)",
image=qrcode, type="success", roomid=roomid)