Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: users

still having problems with django serving static files

 

 

Cherokee users RSS feed   Index | Next | Previous | View Threaded


lazyweb at gmail

Nov 19, 2009, 3:11 AM

Post #1 of 3 (348 views)
Permalink
still having problems with django serving static files

Ok, I've tried a few things, and no success. I'm sure it's a small
error, magnified by my time constraints.

I have a site which I set up using the django wizard. I'm running
cherokee .99.28.

Instead of using a 'media' directory, my static path is called 'static'

What is happening is that the static paths are not being found by
cherokee. I get cherokee 404 errors when I try to access the css, for
example

my config:

vserver!20!nick = brand-manager.ca
vserver!20!rule!300!encoder!deflate = 0
vserver!20!rule!300!encoder!gzip = 0
vserver!20!rule!300!expiration = time
vserver!20!rule!300!expiration!time = 7d
vserver!20!rule!300!handler = file
vserver!20!rule!300!handler!iocache = 1
vserver!20!rule!300!match = directory
vserver!20!rule!300!match!directory = /static
vserver!20!rule!300!match!final = 1
vserver!20!rule!300!no_log = 0
vserver!20!rule!300!only_secure = 0
vserver!20!rule!200!handler = file
vserver!20!rule!200!match = fullpath
vserver!20!rule!200!match!final = 1
vserver!20!rule!200!match!fullpath!1 = /favicon.ico
vserver!20!rule!200!match!fullpath!2 = /robots.txt
vserver!20!rule!200!match!fullpath!3 = /crossdomain.xml
vserver!20!rule!100!encoder!gzip = 1
vserver!20!rule!100!handler = scgi
vserver!20!rule!100!handler!balancer = round_robin
vserver!20!rule!100!handler!balancer!source!1 = 1
vserver!20!rule!100!handler!check_file = 0
vserver!20!rule!100!handler!error_handler = 1
vserver!20!rule!100!match = default
vserver!20!rule!100!match!final = 1
source!1!host = /tmp/cherokee-source1.sock
source!1!interpreter = python /var/sites/brandmanager/manage.py
runfcgi protocol=scgi socket=/tmp/cherokee-source1.sock


example of the problem: go to http://brand-manager.ca

you'll see data with no static images. Try to get one of the
stylesheets, (http://brand-manager.ca/static/css/style.css) and you
will get a 404 from cherokee.

I know that my problems are my own, but if i don't get this working
ASAP, I'll be forced to switch to nginx! Please help!


--
Kevin Beckford
Lead Developer,
Lazyweb Construction Company,
http://lazyweb.ca
kevin [at] lazyweb
_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee


alvaro at octality

Nov 19, 2009, 3:30 AM

Post #2 of 3 (332 views)
Permalink
Re: still having problems with django serving static files [In reply to]

Hello Kevin,

On 19/11/2009, at 12:11, kevin beckford wrote:

> you'll see data with no static images. Try to get one of the
> stylesheets, (http://brand-manager.ca/static/css/style.css) and you
> will get a 404 from cherokee.

What's the document root of that virtual server?

A couple of things to check:

- Does $(document_root) + /static/css/style.css exist?
- Are you certain the request actually matches the second virtual host?

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee


alvaro at octality

Nov 19, 2009, 4:55 AM

Post #3 of 3 (329 views)
Permalink
Re: still having problems with django serving static files [In reply to]

On 19/11/2009, at 13:49, kevin beckford wrote:

>>> you'll see data with no static images. Try to get one of the
>>> stylesheets, (http://brand-manager.ca/static/css/style.css) and you
>>> will get a 404 from cherokee.
>>
>> What's the document root of that virtual server?
>
> vserver!20!document_root = /var/sites/brandmanager/static/

There you are! :)

If the virtual server's document root is /var/sites/brandmanager/static/ and the public web directory /static doesn't define a custom document root, the /static/example.txt request would be evaluated as /var/sites/brandmanager/static/static/example.txt (notice the second /static).

I'd recommend you to set a custom document root in the "Directory /static" rule, so it points to /var/sites/brandmanager/static/

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee

Cherokee users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.