Noobe alert

46 views
Skip to first unread message

Gerald Klein

unread,
Nov 17, 2012, 2:27:03 PM11/17/12
to django...@googlegroups.com
Hi, I finally got a project in Django and I have a "what I hope is an easy question" I started to set up a production server and yes the admin css dissappeared, I went though the docs and followed them. I used the Collect Static Files method and still no joy. Here is my info: 

#settings.py
MEDIA_ROOT = '/var/www/virtualenv-test/ENV/testsite/media/'
STATIC_ROOT = '/var/www/virtualenv-test/ENV/testsite/static/'

#niginx


    root /var/www/virtualenv-test/ENV/testsite;

    location /media/ {
        root /var/www/virtualenv-test/ENV/testsite/media;
    }

    location /static/ {
        root /var/www/virtualenv-test/ENV/testsite/static;
    }

My project is located in /var/www/virtualenv-test/ENV/

the project is testsite so the hierarchy inside ENV is:

testsite/
        media/
        static/all files from collect static files
        testsite/
                __init__.py
                settings.py
                urls.py
                wsgi.py
        manage.py

I am using version (1, 4, 2, 'final', 0). 

If somebody can point out the probably obvious problem that I am missing I would greatly appreciate it. 

thanks in advance for your help

--jerry

-- 

j...@zognet.com

708-599-0352


Arch Awesome, Ranger & Vim the coding triple threat.

Linux registered user #548580 



Rafael E. Ferrero

unread,
Nov 30, 2012, 6:47:34 AM11/30/12
to django...@googlegroups.com
Hello gerald !!, are you still with this probelm ?

2012/11/17 Gerald Klein <j...@zognet.com>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Rafael E. Ferrero
Claro: (03562) 15514856

Chris Cogdon

unread,
Nov 30, 2012, 6:12:24 PM11/30/12
to django...@googlegroups.com, j...@zognet.com
Check the error log for nginx to see if there's any hint of why the statics aren't showing up.

My best guess is that the web server is running as a user that does not have access to the files, and the error log should be showing up with various "permission denied" messages.

The usual culprit is that while the static directory and files are readable by everyone, the parent directories do not have the "execute" permission bit set. On a directory "execute" means the ability to trasverse the directory and get access to the contents, but not get a directory listing.

To fix, try something like this:

chmod a+x /var /var/www /var/www/virtualenv-test /var/www/virtualenv-test/ENV /var/www/virtualenv-test/ENV/testsite /var/www/virtualenv-test/ENV/testsite/static

Gerald Klein

unread,
Nov 30, 2012, 6:22:12 PM11/30/12
to django...@googlegroups.com
Hey and thanks for the post, I actually posted this back on saturday and I figured it out, actually the way you are saying but it wasn't the permissions. I had to much info, the url going into nginx had two static  directories next to each other, at first I tried to remove one but I decided to go with an empty string for STATIC_ROOT and that was it. No problems now, (basically follow the docs) duhh. But thanks I appreciate the post. 

--jerry

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/kmAdUKxb57UJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Reply all
Reply to author
Forward
0 new messages