Cannot find static files when using mod_wsgi and apache

31 views
Skip to first unread message

Joel Mathew

unread,
Aug 31, 2018, 9:31:35 PM8/31/18
to django...@googlegroups.com
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/settings.py contains:
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static/")

]
STATIC_URL = '/static/'
STATIC_ROOT = '/home/joel/myappointments/static/'
#'/home/joel/myappointments/appointments/static/'

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

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

I get links like:
http://mysite.com/static/appointments/propellor/typography.css
which are broken.
If I use the development server, it all works.

Jason

unread,
Sep 1, 2018, 8:01:11 AM9/1/18
to Django users
Reply all
Reply to author
Forward
0 new messages