Static files are not loaded in a Django website hosted on Bluehost
Question: as you can see it live on the website: <http://www.workshopvenues.com> the
**static** files that are under /assets/* are not loaded correctly.

I expect this url (for example) to be valid:
<http://www.workshopvenues.com/assets/ico/apple-touch-
icon-144-precomposed.png> but it's not (as you can verify clicking on it).

This is what I have in my **settings.py**

    
    
    STATIC_ROOT = '/home6/ptlugorg/workshopvenues/workshopvenues/workshopvenues/assets/'
    
    STATIC_URL = 'http://www.workshopvenues.com/assets/'
    
    STATICFILES_DIRS = (
        '/home6/ptlugorg/workshopvenues/workshopvenues/workshopvenues/assets/',
    )
    

The paths are correct, I've double checked them:

    
    
    ptlugorg@ptlug.org [~/workshopvenues/workshopvenues/workshopvenues/assets]# pwd
    /home6/ptlugorg/workshopvenues/workshopvenues/workshopvenues/assets
    

if it may help, I'm serving the website using fastcgi. I've followed the
instructions here
<http://simplyargh.blogspot.co.uk/2012/04/python-27-django-14-on-
bluehost.html>

and these are my configuration files.

**.htaccess**

    
    
    ptlugorg@ptlug.org [~/public_html/workshopvenues]# cat .htaccess 
    AddHandler fcgid-script .fcgi
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ workshopvenues.fcgi/$1 [QSA,L]
    

**workshopvenues.fcgi**

    
    
    ptlugorg@ptlug.org [~/public_html/workshopvenues]# cat workshopvenues.fcgi 
    #!/home6/ptlugorg/python27/bin/python27
    import sys, os
    
    # Add a custom Python path.
    sys.path.insert(0, "/home6/ptlugorg/python27")
    sys.path.insert(13, "/home6/ptlugorg/workshopvenues/workshopvenues")
    
    os.environ['DJANGO_SETTINGS_MODULE'] = 'workshopvenues.settings'
    from django.core.servers.fastcgi import runfastcgi
    runfastcgi(method="threaded", daemonize="false")
    

Just in case you are wondering about the **permissions** :

    
    
    ptlugorg@ptlug.org [~/workshopvenues/workshopvenues/workshopvenues]# ls -al
    total 52
    drwxr-xr-x  3 ptlugorg ptlugorg 4096 Aug  9 03:31 ./
    drwxr-xr-x  4 ptlugorg ptlugorg 4096 Aug  9 02:52 ../
    drwxr-xr-x 11 ptlugorg ptlugorg 4096 Aug  8 15:33 assets/
    -rw-r--r--  1 ptlugorg ptlugorg    0 Aug  8 14:23 __init__.py
    -rw-r--r--  1 ptlugorg ptlugorg  144 Aug  8 14:25 __init__.pyc
    -rw-r--r--  1 ptlugorg ptlugorg  430 Aug  8 15:20 secrets.py
    -rw-r--r--  1 ptlugorg ptlugorg  527 Aug  8 15:20 secrets.pyc
    -rw-r--r--  1 ptlugorg ptlugorg 5779 Aug  9 03:31 settings.py
    -rw-r--r--  1 ptlugorg ptlugorg 3399 Aug  9 03:31 settings.pyc
    -rw-r--r--  1 ptlugorg ptlugorg  614 Aug  8 14:23 urls.py
    -rw-r--r--  1 ptlugorg ptlugorg  467 Aug  8 15:23 urls.pyc
    -rw-r--r--  1 ptlugorg ptlugorg 1150 Aug  8 14:23 wsgi.py
    -rw-r--r--  1 ptlugorg ptlugorg 1058 Aug  8 15:21 wsgi.pyc
    
    ptlugorg@ptlug.org [~/workshopvenues/workshopvenues/workshopvenues/assets]# ls -al
    total 48
    drwxr-xr-x 11 ptlugorg ptlugorg 4096 Aug  8 15:33 ./
    drwxr-xr-x  3 ptlugorg ptlugorg 4096 Aug  9 03:31 ../
    drwxr-xr-x  5 ptlugorg ptlugorg 4096 Aug  8 15:33 admin/
    drwxr-xr-x  5 ptlugorg ptlugorg 4096 Aug  8 14:23 bootstrap/
    drwxr-xr-x  2 ptlugorg ptlugorg 4096 Aug  8 14:23 css/
    drwxr-xr-x  5 ptlugorg ptlugorg 4096 Aug  8 15:33 django_extensions/
    drwxr-xr-x  2 ptlugorg ptlugorg 4096 Aug  8 14:23 font-awesome/
    drwxr-xr-x  2 ptlugorg ptlugorg 4096 Aug  8 14:23 ico/
    drwxr-xr-x  7 ptlugorg ptlugorg 4096 Aug  8 14:23 img/
    drwxr-xr-x  2 ptlugorg ptlugorg 4096 Aug  8 14:23 js/
    drwxr-xr-x  5 ptlugorg ptlugorg 4096 Aug  8 14:23 prettyPhoto/
    

Everything seems correct, but it still doesn't work as expected. Do you have
any idea of where the problem could be? What tests I could do to verify if
something is wrong?

Thanks for your help!


Answer: Thanks to a kind user in **#django** (Freenode IRC channel) named **mattmcc**
, I've been able to fix it. Actually it was a problem in the **STATIC_ROOT**.
It was pointing to the phisical file location instead of pointing to the
**DOCUMENT ROOT location**.

The correct **settings.py** is like this:

    
    
    STATIC_ROOT = '/home6/ptlugorg/public_html/workshopvenues/assets/'
    
    STATIC_URL = '/assets/'
    
    STATICFILES_DIRS = (
        '/home6/ptlugorg/workshopvenues/workshopvenues/workshopvenues/assets/',
    )
    

Everything works now :)

