python - Static files are not loaded in a Django website hosted on Bluehost -


as can see live on website: http://www.workshopvenues.com static files under /assets/* not loaded correctly.

i expect url (for example) valid: http://www.workshopvenues.com/assets/ico/apple-touch-icon-144-precomposed.png it's not (as can verify clicking on it).

this have in 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 correct, i've double checked them:

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

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

and these 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 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' django.core.servers.fastcgi import runfastcgi runfastcgi(method="threaded", daemonize="false") 

just in case wondering 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, still doesn't work expected. have idea of problem be? tests verify if wrong?

thanks help!

thanks kind user in #django (freenode irc channel) named mattmcc, i've been able fix it. problem in static_root. pointing phisical file location instead of pointing document root location.

the correct settings.py this:

static_root = '/home6/ptlugorg/public_html/workshopvenues/assets/'  static_url = '/assets/'  staticfiles_dirs = (     '/home6/ptlugorg/workshopvenues/workshopvenues/workshopvenues/assets/', ) 

everything works :)


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -