Created
April 13, 2015 01:38
-
-
Save phpdude/cf931d476248bdbc646e to your computer and use it in GitHub Desktop.
Lifehack! Nginx proxy django static files with DEBUG=True.
This file contains hidden or 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
location /static { | |
root /path/to/project/; | |
try_files $uri @django; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes you need to proxy your django dev server with nginx without disabling DEBUG.
You can collectstatic everytime you change it, but not me :-)
This configuration tries collected static files folder first and fetch it via your django dev server if nothing found in collected.
ps: @django is your named nginx location for proxing django requests.