So basically I've deployed my applicaiton on vps with apache and mod wsgi. For my static files I've used {% url %} template tag like this :
<link href="{% static "bootstrap.min.css" %}" rel="stylesheet">
Django wasn't loading static files because it was creating relative url so I fixed it by
<link href="/{% static "bootstrap.min.css" %}" rel="stylesheet">
But now when I go to /admin pages it's not loading static files, again because of the relative urls. How can I fix this ?
Here's my mod wsgi :
import os
import sys
import site
# Add the app's directory to the PYTHONPATH
sys.path.append('/home/tshirtnation')
sys.path.append('/home/tshirtnation/tshirtnation')
os.environ['DJANGO_SETTINGS_MODULE'] = 'tshirtnation.settings'
os.environ['PYTHON_EGG_CACHE'] = '/tmp'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
And my apache configuration :
#Listen 80
<VirtualHost *:80>
ServerAdmin marijus.merkevicius@gmail.com
ServerName 5.199.166.109
WSGIDaemonProcess ts threads=25
WSGIProcessGroup ts
Alias /static /home/tshirtnation/staticfiles
WSGIScriptAlias / /home/tshirtnation/index.wsgi
</VirtualHost>
Let me know if you need anything else.