I have a website that will show a QR code of my bitcoin wallet (public key), I will ask the client to deposit bitcoins there, I want to know which wallet (public key) was the one that deposited this in order to know which client is paying for a service that I am going to give you. I am using Python and Django to create the WEB page
You cannot; Bitcoin has no concept of a "sender" of a transaction.
If you want to know which invoice/bill has been paid, give out a new address for every payment you expect.
Bitcoin block explorer sites sometimes do show the "input addresses" of a transaction, but these do not have the properties you generally expect from a sender:
- There may be 1, or more, or even no identifiable input addresses.
- The addresses may not all belong to the sender, in case of a payjoin transaction.
- The addresses may not belong to the sender at all. For example if the sender uses an exchange site, the addresses you see will belong to the exchange.
- You don't know anything about where money goes if you'd try to send coins back there. If you want a refund address, you need to ask the payer for one.
That won't work: Bitcoin transactions do not reliably identify the sender.
Bitcoin addresses are unlike (e)mail addresses. Think of bitcoin addresses as "invoice identifiers": whenever you want to get paid, request to be paid to a new address on your invoice. Then, whenever you get paid, you know which invoice was paid.
Bitcoin wallets have many addresses and addresses should not be reused.