I am trying to deploy a Django based product on an Ubuntu server with Apache. Everything goes well so far, and I can get de applications served by Apache, but I find that these applications lose all their styling.
This is the first time I do this, so I made some research and found and followed this tutorial that is pretty good, but I haven't found any reference to the problem I am having.
This is in my settings.py
:
STATICFILES_DIRS = (os.path.join(BASE_DIR,'FrontEndApp','public'),)
STATIC_URL = '/res/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
And this is my 000-default.conf
:
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /home/axel/IntellibookProject/Intellibook/static
<Directory /home/axel/IntellibookProject/Intellibook/static>
Require all granted
</Directory>
<Directory /home/axel/IntellibookProject/Intellibook/Intellibook>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess Intellibook python-home=/home/axel/IntellibookProject/IntellibookVenv python-path=/home/axel/IntellibookProject/Intellibook
WSGIProcessGroup Intellibook
WSGIScriptAlias / /home/axel/IntellibookProject/Intellibook/Intellibook/wsgi.py
I made the test serving the applications with pyhton manage.py runserver 0.0.0.0:8000
, and everything worked perfectly. The problem exists only when the applications are served with Apache.