Я сталкиваюсь с проблемой со статическими файлами (Django1.3), когда пытаюсь развернуть его на моем локальном сервере Apache (apache2 + mod_wsgi), проблема только для статического содержимого остальные части в порядке [это работает на сервере devlopment].
Мой проект теперь находится в папке «testcloud» в Ubandu Desktop, Мой проект
зовут DjangoApis, ниже структура моего проекта:
Desktop-> testcloud:
DjangoApis
...
mywebapp
static
templates
templatetags
urls.py
views.py
myapis
.....
Settings.py
STATIC_ROOT = '/home/jisson/Desktop/testcloud.aws/DjangoApis/
teststaticfiles/'
STATIC_URL = '/static/'
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.media",
"django.core.context_processors.static",
)
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__),'templates').replace('\
\','/'),
)
INSTALLED_APPS = (
'DjangoApis.mywebapp',
'DjangoApis.myapis',
)
STATICFILES_DIRS = (
os.path.join(os.path.dirname(__file__),'static').replace('\
\','/'),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
/ и т.д. / apache2 / сайты / включены / DjangoApis:
Alias /favicon.ico /home/jisson/Desktop/testcloud.aws/DjangoApis/
static/favicon.ico
AliasMatch ^/([^/]*\.css) /home/jisson/Desktop/testcloud.aws/
DjangoApis/static/styles/$1
Alias /static/ /home/jisson/Desktop/testcloud.aws/DjangoApis/static/
<Directory /home/jisson/Desktop/testcloud.aws/DjangoApis/static>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / /home/jisson/Desktop/testcloud.aws/DjangoApis/
django.wsgi
apache errorlog:
tail /var/log/apache2/error.log
[Sat Dec 10 03:16:36 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticjs,
referer: http://test.webapp/
[Sat Dec 10 03:16:36 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticjs,
referer: http://test.webapp/
[Sat Dec 10 03:16:36 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticjs,
referer: http://test.webapp/
[Sat Dec 10 03:16:36 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticjs,
referer: http://test.testapp/
[Sat Dec 10 03:16:45 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticimages,
referer: http://test.webapp/
[Sat Dec 10 03:16:45 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticimages,
referer: http://test.webapp/
[Sat Dec 10 03:16:45 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticimages,
referer: http://test.webapp/
[Sat Dec 10 03:16:45 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticimages,
referer: http://test.webapp/
[Sat Dec 10 03:16:45 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticimages,
referer: http://test.webapp/
[Sat Dec 10 03:16:45 2011] [error] [client 127.0.0.1] File does not
exist: /home/jisson/Desktop/testcloud.aws/DjangoApis/staticimages,
referer: http://testwebapp/
Журнал ошибок Firebug:
test.webapp (line 62)
"NetworkError: 404 NOT FOUND - http://test.webapp/css/styles/index.css/"
/css/s...ex.css/
"NetworkError: 404 Not Found - http://test.webapp/static/images/logo.jpg"
logo.jpg
"NetworkError: 404 Not Found - http://test.webapp/static/images/line.jpg"
line.jpg
"NetworkError: 404 Not Found - http://test.webapp/static/images/banner_phone.jpg"
.........................
Примечание Я использовал команду collectstatic.
Пожалуйста, помогите мне решить проблему, спасибо в Advace.