Почему то барахлят статичные файлы, пишет что 404 not found
---settings.py----
STATIC_ROOT = "/home/projects/testproject/static"
STATIC_URL = '/static/'
STATICFILES_DIRS = (
'/home/projects/testproject/static',
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
MEDIA_ROOT = "home/projects/testproject/media"
MEDIA_URL = "/media/"
--urls.py--
from django.conf.urls import patterns, include, url
from django.contrib import admin
from programms import views
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'testproject.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url('^$', views.main_page),
)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += staticfiles_urlpatterns()
if settings.DEBUG:
# static files (images, css, javascript, etc.)
urlpatterns += patterns('',
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {
'document_root': settings.STATIC_ROOT}))
--nginx.conf---
upstream django{
server unix:///home/projects/testproject/testproject.sock;
}
server{
listen 80;
server_name mysite.ru;
charset utf-8;
client_max_body_size 75M;
location /media/{
alias /home/projects/testproject/media;
}
location /static/{
alias /home/projects/testproject/static;
}
location /{
uwsgi_pass django;
include /home/projects/testproject/uwsgi_params;
}
}
------------------------------------------------------------------------------------
collectstatic тоже делал...