Django STATIC_URL on requests

107 Views Asked by At

I have this Django project (https://github.com/chakki-works/doccano) that I'm trying to deploy using Apache + mod_wsgi.

I set up my .conf file to work as a Daemon proccess where application is served under an alias (/doccano) path:

Alias /media/ /var/www/doccano/media/
Alias /static/ /var/www/doccano/app/staticfiles/

WSGIDaemonProcess doccano user=apache group=apache python-home=/var/www/doccano/env
WSGIProcessGroup doccano

WSGIApplicationGroup %{GLOBAL}

WSGIScriptAlias /doccano /var/www/doccano/app/app/wsgi.py

The application was doing fine while static files were not being served as I mapped /doccano alias:

Main page request enter image description here

The Alias /static/ /var/www/doccano/app/staticfiles/ fixed static files problem.

But I still want to serve other applications in this server, so mapping /static/ may not be a good idea.

So I want to know what is the best approach for this situation. I was trying to add /doccano/ at the beginning of the static requests url setting STATIC_URL=/doccano/static/ but I think this property is not for doing this type of setting.

0

There are 0 best solutions below