Friday, August 31, 2018

Cannot find static files when using mod_wsgi and apache

I'm having trouble getting serving static files.

My project is at /home/joel/myappointments
The app is at /home/joel/myappointments/appointments

An example template contains:
<link rel="stylesheet" href="{% static
'appointments/css/bootstrap.4.1.3.min.css' %}">

myappointments/myappointments/ contains:
# Static files (CSS, JavaScript, Images)
os.path.join(BASE_DIR, "static/")

STATIC_URL = '/static/'
STATIC_ROOT = '/home/joel/myappointments/static/'

I've tried different options. The present option is after creating
/home/joel/myappointments/static/ and running
python3 collectstatic

While running the application with:
(venv) root@localhost:/home/joel/myappointments# mod_wsgi-express
start-server --host --user www-data --group
www-data --port 80

I get links like:
which are broken.
If I use the development server, it all works.

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment