[Django]-Apache config for static site on root, and Django on sub-locations

4๐Ÿ‘

โœ…

I had the almost exact same problem. In Apaches virtual host config for the site use

WSGIScriptAliasMatch ^(/(admin|api)) /path/to/django/my_app/wsgi.py$1

instead of

WSGIScriptAlias /admin /path/to/django/my_app/wsgi.py
WSGIScriptAlias /api   /path/to/django/my_app/wsgi.py

Check these Q&A for further information:

Django (wsgi) and WordPress coexisting in Apache virtualhost

Reconfiguring Apache to serve website root from new php source and specific sub-urls from old django site

๐Ÿ‘คCreech

Leave a comment