web2py does not seem to support http authentication on PA

Hi -

I'm trying to do something along the lines of Restful API with HTTPS and authentication

And using notes here (!searchin/web2py/authentication/web2py/e13XC9FHR3g/DL13ikpYDbkJ) and here (

I have come to the conclusion that pythonanywhere may not be handling the standard WSGI_authentication as expected.

For Apache you would add this to the Apache config: WSGIPassAuthorization On but PA is using nginx.

Has anyone dealt with this issue before - any suggestions or solutions?



OK, found the answer - there is a setting in web2py iteself that is required to allow http auth. See:

insert this line into after the rest of the auth settings

auth.settings.allow_basic_login = True

This allows the previously linked methods to work

glad you figured it out :)