python - How to serve Django static file on nginx -


i trying configure nginx uwsgi serve django app layout of admin panel distorted totally...

here nginx configuration:

upstream django {     server 127.0.0.1:8000;     }  server {     # port site served on     listen      4321;     # domain name serve     server_name localhost;     charset     utf-8;     access_log /var/log/nginx/local-access.log;     error_log /var/log/nginx/local-error.log;      client_max_body_size 75m;       location /static/admin {      alias /usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin/;     }      location / {     uwsgi_pass  django;     include     /etc/nginx/uwsgi_params;     } 

}

here nginx error: 2013/05/13 18:13:26 [error] 12491#0: *255 open() "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin/js/ddsmoothmenu.js" failed (2: no such file or directory)

access logs:

[pid: 6848|app: 0|req: 8/13] 127.0.0.1 () {42 vars in 773 bytes} [tue may 14 12:59:30 2013] /admin/ => generated 1960 bytes in 995 msecs (http/1.1 200) 7 headers in 438 bytes (1 switches on core 0) [pid: 6847|app: 0|req: 3/14] 127.0.0.1 () {44 vars in 858 bytes} [tue may 14 12:59:32 2013] /admin/brightcouponsapp/static/admin/css/login.css => generated 0 bytes in 28 msecs (http/1.1 500) 1 headers in 78 bytes (1 switches on core 0) 

the static files belongs django app working fine django admin layout not can 1 me out...

check out collectstatic command instead of serving files site-packages directory. management command copy static files apps static_root.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -