Django two websites hosted with Apache, urls do not work at one of them

  apache, django, windows

I did set up two websites (hosted locally). I’m on windows so config may look odd.

WSGIPythonHome "C:/var/www/magazyn/env39"
WSGIPythonPath "C:/var/www/magazyn/venv/Lib/site-packages;C:/var/www/magazyn/rootkat/"

    ServerName www.magazyn-stolarz.pl
    LoadFile "C:/Python39/python39.dll"
    LoadModule wsgi_module "C:/var/www/magazyn/env39/lib/site-packages/mod_wsgi/server/mod_wsgi.cp39-win_amd64.pyd"
    WSGIScriptAlias /awizacje "C:/var/www2/awizacje/rootkat/awizacje/wsgi.py"
    WSGIScriptAlias / "C:/var/www/magazyn/rootkat/magazyn/wsgi.py"
    
    <Directory "C:/var/www2/awizacje/rootkat/awizacje/">
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>

    Alias /statica "C:/var/www2/static/"
    <Directory "C:/var/www2/static/">
        Require all granted
    </Directory>

    <Directory "C:/var/www/magazyn/rootkat/magazyn/">
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>

    Alias /static "C:/var/www/static/"
    <Directory "C:/var/www/static/">
        Require all granted
    </Directory>

With that configuration base site works perfectly ("pc-name/") but the second one ("pc-name/awizacje") does not. Main url works like it should but every button sends me to ("pc-name/button-url") and not ("pc-name/awizacje/button-url"). I have set ROOT_URLCONF = 'awizacje.urls' in settings.py. Is there something I am missing? Any way I should change settings to take base url into account?

Source: Windows Questions

LEAVE A COMMENT