Listen to the input. When the user types an @, followed by a
character, make a call to an url on your server
(/user/lookup/?username=joe for example) that routes to a view which
looks up up users beginning with joe. Return it as json and display it
in a dropdown.

To make is much simpler, you need to use @ as a keyword that is going to be used for understanding the beginning of a user name .