Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #25203 -- Documented how to pass Apache environment variables t…
…o Django.
- Loading branch information
1 parent
e3720b9
commit 47016d4
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47016d4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this certainly works to some extend I'd like to know what @GrahamDumpleton thinks about this. IIRC he has a blog post advicing against this pattern.
47016d4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern is fundamentally weird, and I don't really like documenting it. WSGI environ vars are per-request, it's strange and inefficient to re-set process-global OS environ vars based on them on every single request. I also wonder (but am not sure; Graham would know) if this technique could cause strange race conditions if you fail to use daemon mode with a separate process group per site, because it would actually be changing the environ for all your sites on each request to any of the sites.
IMO the right way to set environment variables in Apache is the
envvars
file. That doesn't work if you're serving multiple Django sites from a single Apache instance. In that case I think it's better to just direct each site to a different WSGI script file, which sets the env vars it needs once at startup to fixed values.47016d4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted in 83ea3bc.