How to enable WSGIPassAuthorization for Django?
Asked Answered
F

2

5

I am testing my Django API endpoints but I need to enable WSGIPassAuthorization to let Authorization header be received. Where should I enable it?

PS: I am on macOS, but any answer might be useful!

Froehlich answered 17/3, 2018 at 18:39 Comment(6)
In your apache configEberhart
But I never setup any apache configuration. Is it done by default? Where are these configurations to edit them?Froehlich
So how do you use mod_wsgiEberhart
O am not using it, but it seems that I need it to activate this optionFroehlich
Yeah.. I'll write an answer.. Please accept itEberhart
Are you using Apache Server.app version of mod_wsgi? Or are you using mod_wsgi-express? They are the only ways of using mod_wsgi on macOS where you wouldn't have had to configure Apache yourself. If you are using mod_wsgi-express, directly or via Django runmodwsgi, then that directive is set by default.Thundersquall
E
7

If you are using mod_wsgi, just install apache and use it inside your VirtualHost.

And then: WSGIPassAuthorization On

Eberhart answered 17/3, 2018 at 20:54 Comment(0)
T
3

You have to go to /etc/apache2/sites-enabled where your configuration file sits either the one with SSL certificates or the one without and add WSGIPassAuthorization On where the file ends.

Timer answered 10/9, 2021 at 10:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.