Hi all!
Today I suddenly figured out that enabling Channels breaks URL "routing" inside Django Admin when FORCE_SCRIPT_NAME is set. I have Django running behind Nginx reverse proxy with /api/ URL prefix. To make Django respect this prefix I set FORCE_SCRIPT_NAME = '/api' in the Django setting file. Everything works fine until I enable Channels by INSTALLED_APPS += ['channels']. After this Django Admin login screen POSTs data the wrong URL, the one without /api/ prefix. If I disable Channels it works fine again. I simply do not know where to dig further. Any help is appreciated.
My setup:
Yup, there is no support for this yet as it's overriding a WSGI-specific thing and we'd need to make sure it interoperates correctly. You can instead use the --root-path option to Daphne to provide this right now until this is fixed.
@andrewgodwin Thank you. I will use --root-path for now.
Hey! I'm at the DjangoCon EU sprints. I'm working on this issue.
Hey @andrewgodwin! Opened the #1064 PR. Could you check if everything is OK?
Thank you for all the help :)
Looks lovely - thanks for your work on that!
Most helpful comment
Hey! I'm at the DjangoCon EU sprints. I'm working on this issue.