Search code examples
pythondjangoauthenticationtastypie

How can you change what the password prompt says in Django-Tastypie?


In django-tastypie when I have BasicAuthentication enabled my browser pops up a password prompt that says:

The site says "django-tastypie"

Naturally, I want something better in there, but I'm not sure if it's a WSGI configuration or something else. How do I change what "the site says"?


Solution

  • You can change this by setting the realm for BasicAuthentication. In your code you'll want to do something like:

    class Meta:
        authentication = BasicAuthentication(realm="your-website.com")
    

    Simple as that.